Skip to main content

ASPxClientGridView.GetSelectedFieldValues(fieldNames, onCallback) Method

Returns the values of the specified fields within selected rows.


    fieldNames: string,
    onCallback: ASPxClientGridViewValuesCallback
): void


Name Type Description
fieldNames string

The names of data source fields.

onCallback ASPxClientGridViewValuesCallback

The JavaScript function that gets the list of row values as a parameter.


The GetSelectedFieldValues method sends a callback to the server to obtain the specified field values and passes them back to the client. Then it calls the onCallBack function that gets the values as a parameter.

To get the field values of selected rows on the server, call the ASPxGridBase.GetSelectedFieldValues(System.String[]) method.


  • When cell merge is enabled, the GetSelectedFieldValues method is not in effect.

Web Forms Example

Run Demo: ASPxGridView - Using Checkboxes

ASPxGridView - GetSelectedFieldValues

<dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" KeyFieldName="CustomerID"
        <dx:GridViewCommandColumn ShowSelectCheckbox="true" VisibleIndex="0" />
        <dx:GridViewDataTextColumn FieldName="ContactName" VisibleIndex="1" />
        <dx:GridViewDataTextColumn FieldName="Country" VisibleIndex="6" />
    <SettingsBehavior AllowSelectSingleRowOnly="true" />
    <ClientSideEvents SelectionChanged="grid_SelectionChanged" />
<dx:ASPxMemo ID="ASPxMemo1" ClientInstanceName="memo" runat="server" Height="50px" Width="50%">
function grid_SelectionChanged(s, e) {
    s.GetSelectedFieldValues("ContactName;Country", GetSelectedFieldValuesCallback);
function GetSelectedFieldValuesCallback(values) {
    for (var i = 0; i < values.length; i++) {
        memo.SetText("ContactName: " + values[i][0] + "; Country: " + values[i][1]);

MVC Example

Run Demo: GridView - Row Selection (MVC)

@Html.DevExpress().ListBox(settings => {
    settings.Name = "SelectedRows";
    settings.Width = Unit.Percentage(100);
    settings.Height = 250;
    settings.Properties.EnableClientSideAPI = true;
    settings.Theme = "MaterialCompactOrange";
function SelectionChanged(s, e) {
    s.GetSelectedFieldValues("ContactName", GetSelectedFieldValuesCallback);
function GetSelectedFieldValuesCallback(values) {
    try {
        for (var i = 0; i < values.length; i++) {
    } finally {

Get the Values of Complex Fields

The GetSelectedFieldValues method returns column values only. So, if a grid is bound to a collection of complex objects (for example, KeyFieldName="Product.Category.CategoryName"), create a hidden column for this complex field. The grid does not render hidden columns, but allows you to get their data on the server side.

Web Forms Example

ASPxGridView1.Columns.Add("SubRegionInfo.ID").Visible = false;

MVC Example

settings.Columns.Add("SubRegionInfo.ID").Visible = false;
See Also