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

Access only visible rows

8 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 18 Mar 2011, 01:15 PM
I have a grid with 'x' amount of rows. Using the built in filter functions I'm filtering and ending up with 'y' amount of rows. How is it possible to get the collection of visible rows after filtering? ('y')

8 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 18 Mar 2011, 01:47 PM

Hi John,

Working with visible item is not the preferred approach. It is best to work with the data itself. For example, you can get all items that remain after filtering from the Items property of the grid.



Best wishes,
Milan
the Telerik team
0
John
Top achievements
Rank 1
answered on 18 Mar 2011, 01:49 PM
Sorry for being unclear with what I want, but I'm trying to access the data available after filtering as you're saying. However, I haven't found a property where I can access that. 
I'm trying to access the information in XAML.
0
Maya
Telerik team
answered on 18 Mar 2011, 02:02 PM
Hello John,

You may use the Items collection of the grid. It will return the number of items being filtered as well.
 

Regards,
Maya
the Telerik team
0
John
Top achievements
Rank 1
answered on 18 Mar 2011, 02:34 PM
Is there a way to access the item collection in XAML? 
0
Maya
Telerik team
answered on 18 Mar 2011, 02:40 PM
Hello John,

May you provide a bit more details about the exact scenario you want to accomplish ? What do you want to use the Items collection in xaml for ?
 

All the best,
Maya
the Telerik team
0
John
Top achievements
Rank 1
answered on 18 Mar 2011, 02:45 PM
Because I wanna bind it to a property and base a graph on the filtered rows. 

Expample: 
I have 10 rows, and I want to show a graph based on all 10 rows. 
I filter on name etc, and ends up with 4 rows, the graph should be reflecting what's available in the grid at the moment. 
0
Vlad
Telerik team
answered on 18 Mar 2011, 03:06 PM
Hi,

 You can bind the chart to the grid Items collection directly. 

Greetings,
Vlad
the Telerik team
0
John
Top achievements
Rank 1
answered on 18 Mar 2011, 04:11 PM
The Graph will be in another control. Therefore I wanna bind it to a property so that I can go thru parentViewModel and so on, and get the values from that. 
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Milan
Telerik team
John
Top achievements
Rank 1
Maya
Telerik team
Vlad
Telerik team
Share this question
or