This question is locked. New answers and comments are not allowed.
Hi,
I would like to filter a column of the grid right after I bind it to a datasource, and would like to keep the option for the user to clear the filter and see all the data.
Here is the code that I am using to filter out results:
foreach (GridViewDataColumn col in radGridView.Columns.OfType<GridViewDataColumn>()) { if (col.UniqueName.ToLower() == "owner") { FilterOperator filterOperator = FilterOperator.Contains; FilterDescriptor descriptor = new FilterDescriptor(col.UniqueName, filterOperator, "ryan"); descriptor.MemberType = col.DataType; radGridView.FilterDescriptors.Add(descriptor); break; } }There are really two questions here:
1. How can I filter the same column with more than one value? In other words I want to see rows where (owner == ryan) OR (owner==bill).
2. When I run the code, I do the rows filtered out, however when I click on the filter for the column I don't get the list of the other owners. In other words, the user cannot clear the filter and see all rows. What is the right of doing that?
Thanks,
Ryan