Skip to main content

ASPxClientGridView.GetRowKey(visibleIndex) Method

Returns the key value of the specified data row.

Declaration

GetRowKey(
    visibleIndex: number
): string

Parameters

Name Type Description
visibleIndex number

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.

Online Example

View Example: How to use jQuery to drag and drop items from one grid to another

Example

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.CallbackEventArgsBase e) {
        Session["CategoryID"] = e.Parameter;
        AccessDataSource1.SelectParameters["CategoryID"].DefaultValue = e.Parameter;
        (sender as ASPxDataView).DataBind();
    }
}
See Also