Search code examples
c#winformstelerik

Check what user typed in filter column in radgridview


I have a radGridView in a form; can i check what user selected as filter? (ex: Contains, Does not contain, Starts with, etc..) And if a filter is selected, what it was typed there?

Example:

enter image description here

I have one column called 'Title' and there i have Contain filter selected and in that filter i typed "TEST". Can i somehow get all those information?


Solution

  • I found the solution. The radgridview has this 'FilterDescriptors' property that saves everything you type in every filter field and also the 'PropertyName' which gives you the column.

    So you can basically do this:

    foreach (var descriptor in this.FilterDescriptors)
    {
         foreach (var column in this.MasterTemplate.Columns)
         {
              if (descriptor.PropertyName == column.FieldName)
              {
                   //do stuff
              }
         }
    }