ASPxClientCardView.GetCardKey(visibleIndex) Method

Returns the key value of the specified card.

Declaration

GetCardKey(
    visibleIndex: number
): string

Parameters

Name Type Description
visibleIndex number

An integer value that specifies the card’s visible index.

Returns

Type Description
string

A string representing the specified card’s key value. If the index passed via the visibleIndex parameter is wrong, or the ASPxGridBase.KeyFieldName property is not set, null is returned.

Remarks

Note

If multiple key fields are set using the grid’s ASPxGridBase.KeyFieldName property, a specific service vertical bar symbol (the symbol |) is used to separate key field values in the string returned by the GetCardKey method.

Example

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.

View Example

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();
    }
}
See Also