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

Filtered Records list

5 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JDB
Top achievements
Rank 1
JDB asked on 26 Mar 2009, 12:28 PM
To be able to use the RadGridView control in our software, we need to be able to get a Filtered result list from the control. I've tried to see the where I could be able to get such a list while debugging after a gridView.ItemsControl.RecordManager.FilterDescription.PropertyChanged event, but I'm unable to find it.

Could anyone point me in the right direction?

 

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Mar 2009, 07:08 AM
Hi RVW,

I have prepared for you small demo application (attached) to illustrate you how to achieve your goal with the current grid version.

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
JDB
Top achievements
Rank 1
answered on 30 Mar 2009, 07:20 AM
Maybe I wasn't clear on what I wanted, or I don't understand how the example can help me get what I want.

What we need is a way to get the list of items after a filter is applied:

Col1    Col2    Col3 
1         A         B
2         A         B
3         A         B
4         C         D
5         C         D
6         C         F
7         E         F

Now, if I would put a filter on Col3 and I only want the rows with 'D' in them, the grid would look like this:

Col1    Col2    Col3 
4         C         D
5         C         D

I need to get that result list out of the grid, but I don't know how.
0
Vlad
Telerik team
answered on 30 Mar 2009, 07:30 AM
Hello RVW,

Generally Records collection of the grid will respect the grid filtering and will return only records that match your criteria.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
JDB
Top achievements
Rank 1
answered on 30 Mar 2009, 07:56 AM
Hi Vlad,

Thanks for your quick response. I hadn't really looked to what the Records collection contained, but to the Count of the collection, which always seemed to be the total number of records in the itemssource.

And the CollectionChanged event on the Records collection is fired 4 times with Action Reset, is that on purpose?
0
Accepted
Vlad
Telerik team
answered on 30 Mar 2009, 09:46 AM
Hello RVW,

You can try to run my demo and filter the grid - the TextBlock value will be changed. As to the CollectionChanged Reset action currently the grid will trigger this on every FIlterDescription set which is not very correct since the filter is not active on initial load - we will do our best to fix this for the upcoming service pack.

Sincerely yours,
Vlad
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
JDB
Top achievements
Rank 1
Answers by
Vlad
Telerik team
JDB
Top achievements
Rank 1
Share this question
or