This is a migrated thread and some comments may be shown as answers.

Extract Searchstring from GridColumn Filtering

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 06 Jul 2011, 07:07 AM
Hello everybody,

We are using several RadGrids with Column Filtering enabled. Some columns use a Template Column with a Template Filter Template while others use standard filter functionality. We use AutoPostBack for each Filter. We need to extract the filter string that is used for filtering in order to process a sophisticated search on the backend.
Is there any possibility to supress the default filter behaviour and execute custom logic?

Thanks in advance.
Marco

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Jul 2011, 08:24 AM
Hello Marco,

Try the following code snippet in ItemCommand event to access the search string.

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
       if (e.CommandName == RadGrid.FilterCommandName)
        {
            TextBox filterBox = (e.Item as GridFilteringItem)["ColumnUniqueName"].Controls[0] as TextBox;
            string strTxt= filterBox.ToString();         
        }
}

Thanks,
Princy.
Tags
Grid
Asked by
Marco
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or