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

How do you set a column to have default filtering?

2 Answers 62 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Daren
Top achievements
Rank 1
Daren asked on 15 Oct 2018, 06:47 PM
I have a column named Status. The status is either Active, or Inactive. At the moment i am using a custom filter to select one or the other for filtering. I want to know how I can set Active as the default filtered item upon load. The columns should only show Entries with the status Active, unless inactive are enabled in the custom filter. 

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Oct 2018, 08:10 AM
Hello Daren,

You would need to add a filter descriptor programmatically in order to pre-filter items in certain column. To achieve this first create a FilterDescriptor according to the column type of the Status field, I guess in your case it could be Boolean FilterDescriptor or Delegate FilterDescriptor, and then add it to the FilterDescriptors collection of RadDataGrid.
Please go to the following topic in our documentation for the exact approach:
DataGrid: Programmatic Filtering

I hope I was of help.

Regards,
Yana
Progress 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
0
Daren
Top achievements
Rank 1
answered on 18 Oct 2018, 01:14 PM
Currently the filter works off of a custom listview and custom button tap in which I learned from the custom filter documentation.
How do I tell it Show only How do I access that custom filter already in place to tell it "Show active at load" while also still able to use the other filtering option. I had used a delegate filter but was only able to get it to show one or the other, and not both when needed.
Tags
DataGrid
Asked by
Daren
Top achievements
Rank 1
Answers by
Yana
Telerik team
Daren
Top achievements
Rank 1
Share this question
or