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

Set default filter to remove all

1 Answer 131 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Iron
Iron
Rob asked on 12 Jun 2015, 10:06 AM

I'm trying to programmatically achieve filtering out of empty strings in a column.

 I.e. I wish to automatically set up the second grid in my attached image.

 I've tried:

 

            suffixFilter.DistinctFilter.RemoveDistinctValue("");
            suffixFilter.DistinctFilter.RemoveDistinctValue(".");
            suffixFilter.DistinctFilter.RemoveDistinctValue(string.Empty);

 

and also:

 

            suffixFilter.FieldFilter.Filter1.Operator = FilterOperator.Contains;
            suffixFilter.FieldFilter.Filter1.Value = ".";

 

but these only achieve the first grid. Please help!

 

Many thanks,

 

R

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 Jun 2015, 01:36 PM
Hi,

Looking at the image attached, it is not clear which is first and which second RadGridView.
You say the code (invoked for suffixFilter) just affects first grid. Would you please share how have you accessed the instance of suffixFilter, does it relate to the second RadGridView at all?

Basically, in order to clear all filters associated with a specific column, you need to call:

column.ClearFilters();

You can additionally refer to the online documentation where the filtering is explained in details.

Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Iron
Iron
Answers by
Dimitrina
Telerik team
Share this question
or