Skip to main content
A newer version of this page is available. .

How to: Create an ASPxCardView at Runtime

This example demonstrates how to create and initialize an ASPxCardView at runtime.

protected void Page_Load(object sender, EventArgs e)
{
    ASPxCardView cv1 = new ASPxCardView();
    cv1.ID = "ASPxCardView1";
    cv1.KeyFieldName = "ProductID";
    Page.Form.Controls.Add(cv1);
    cv1.SettingsBehavior.AllowFocusedCard = true;
    cv1.DataSourceID = "SqlDataSource1";
    cv1.DataBind();
}