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

ASPxClientGridView.GetRowKey(visibleIndex) Method

Returns the key value of the specified data row.

Declaration

GetRowKey(
    visibleIndex: number
): string

Parameters

Name Type Description
visibleIndex number

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

Returns

Type Description
string

A string representing the specified data row’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

The GetRowKey method is in effect for data rows only - it does not work for group rows.

Note

If multiple key fields are set via 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 GetRowKey method.

Example

This example demonstrates how to use the ASPxDataView control to show the ASPxGridView’s detail data.

using System;
using System.Web.UI;
using DevExpress.Web.ASPxDataView;

public partial class _Default : System.Web.UI.Page {
    protected void ASPxDataView1_Load(object sender, EventArgs e) {
        if (Session["CategoryID"] == null) return;
        AccessDataSource1.SelectParameters["CategoryID"].DefaultValue = Session["CategoryID"].ToString();
        (sender as ASPxDataView).DataBind();
    }
    protected void ASPxDataView1_CustomCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) {
        Session["CategoryID"] = e.Parameter;
        AccessDataSource1.SelectParameters["CategoryID"].DefaultValue = e.Parameter;
        (sender as ASPxDataView).DataBind();
    }
}
See Also