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

Get Filtered Items List to Bind To Chart

2 Answers 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ben williams
Top achievements
Rank 1
ben williams asked on 25 May 2010, 01:10 PM
Hi,

I have a Gridview and a Chart. The gridview can be filtered. what i would like is the chart to update its view based on the filter applied by the user but I cannot see how to bind the chart to the filtered list.

//Load data and bind to gridview

 

 

ObservableCollection<People> peopleByYearData = GetPeopleByYear();

 

gridViewPeople.ItemsSource = peopleByYearData;

//this displays the data on a simple bar chart.

 

chartPeopleByYear.ItemsSource = gridViewPeople.ItemsSource;

How do i ensure that the chart updates its view when the gridview is filtered?

i have tried hooking into the Filtered event of the gridview to try and get access to a list of filtered items but I cannot find any such list. The filter displays fine on the gridview but in the Filtered event the gridViewPeople.Items.Count is always == 0.

Thanks


2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 May 2010, 01:26 PM
Hello ben williams,

After you perform filtering , the Items property of RadGridView should contain the list of filtered items you need.

Best wishes,
Pavel Pavlov
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
ben williams
Top achievements
Rank 1
answered on 25 May 2010, 01:53 PM
Thanks for your prompt reply- typically i discovered  a typo pointing to the wrong GridView which had no items. Gah!


Tags
GridView
Asked by
ben williams
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
ben williams
Top achievements
Rank 1
Share this question
or