Skip to main content

How to: Select Rows That Contain the Specified Value

This example demonstrates how to select customers who live in the specified country.

When a user types a country name into the search box and clicks Search, the button’s ButtonClick event handler calls the ASPxClientGridView.PerformCallback method.

The PerformCallback method sends a callback to the server and raises the ASPxGridView.CustomCallback event. This event obtains the country that the user enters.

exGetValuesOnCustomCallback

protected void grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    string country = e.Parameters.ToString();
    grid.Selection.UnselectAll();
    for (int i = 0; i < grid.VisibleRowCount; i++)
        if (grid.GetRowValues(i, "Country") != null)
            if (grid.GetRowValues(i, "Country").ToString() == country)
                grid.Selection.SelectRow(i);
}