How to: Bind the ASPxCardView to Data Created at Runtime (DataTable)

This example shows how to bind the ASPxCardView to data created at runtime.

    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("ID", typeof(int));
        dt.Columns.Add("Data", typeof(string));
        for (int i = 0; i < 50; i++)            
            dt.Rows.Add(new object[] { i, "Row " + i.ToString() });
        ASPxCardView1.DataSource = dt;
        ASPxCardView1.KeyFieldName = "ID";
        ASPxCardView1.DataBind();
    }