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

How to I tell what menu filter option was selected

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 02 Apr 2012, 04:11 PM
I need to be able to know in NeedDataSource event what filter menu option was chosen by the user when filtering.  For example, if the user enters a phrase in the filter and then chooses "Contains", how do I know that the user chose "Contains".  I cannot find this anywhere in the forum or when I search the internet.

2 Answers, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 02 Apr 2012, 04:55 PM
is there something in the FilterExpression of the MasterTableView?  If there is, parsing the string may get you what you are looking for...
0
Shinu
Top achievements
Rank 2
answered on 03 Apr 2012, 05:51 AM
Hello RJ,

You can access the filter function in ItemCommand event as shown below.
C#:
protected void grid1_ItemCommand(object sender, GridCommandEventArgs e)
{
 if (e.CommandName == RadGrid.FilterCommandName)
 {
   Pair filterPair = (Pair)e.CommandArgument;
   string value=filterPair.First.ToString();
 }         
}

Thanks,
Shinu.
Tags
Grid
Asked by
RJ
Top achievements
Rank 1
Answers by
Elliott
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or