ASPxClientGridView.GetRowKey(visibleIndex) Method

Returns the key value of the specified data row.


    visibleIndex: number
): string


Name Type Description
visibleIndex number

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


Type Description

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.


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


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.


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

View Example

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