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

How to: Show ASPxCardView's Detail Information in ASPxDataView

  • 3 minutes to read

The example below demonstrates how to show ASPxCardView’s detail data. You can also refer to the following DevExpress Support Center example: T272616: ASPxCardView - How to display master-detail data using two ASPxCardView controls.

Note

A complete sample project is available in the following repository: https://github.com/DevExpress-Examples/how-to-show-aspxcardviews-detail-information-in-aspxdataview-t283369.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ASPxDataView1_CustomCallback(object sender, DevExpress.Web.CallbackEventArgsBase e)
    {
        Session["CategoryID"] = e.Parameter;
        AccessDataSource1.SelectParameters["CategoryID"].DefaultValue = e.Parameter;
        (sender as ASPxDataView).DataBind();
    }
    protected void ASPxDataView1_Load(object sender, EventArgs e)
    {
        if (Session["CategoryID"] == null) return;
        AccessDataSource1.SelectParameters["CategoryID"].DefaultValue = Session["CategoryID"].ToString();
        (sender as ASPxDataView).DataBind();
    }
}