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 the Find button, 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.


<dx:ASPxButtonEdit ID="ButtonEdit" runat="server" ...>
    <!-- ... -->
    <ClientSideEvents ButtonClick="OnButtonClick" />
<br />
<dx:ASPxGridView ID="Grid" runat="server" ClientInstanceName="ClientGrid"
    OnCustomCallback="Grid_CustomCallback" ...>
        <!-- ... -->
        <dx:GridViewDataTextColumn FieldName="Country"/>
function OnButtonClick(s, e) {
    var text = s.GetText();
protected void Grid_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e) {
    string country = e.Parameters.ToString();
    for(int i = 0; i < Grid.VisibleRowCount; i++)
        if(Grid.GetRowValues(i, "Country") != null)
            if(Grid.GetRowValues(i, "Country").ToString() == country)