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

Use Filtered Grid Rows in another component

10 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeanne
Top achievements
Rank 2
Jeanne asked on 21 May 2009, 07:07 PM
Hi,

I was wondering if anyone has any ideas on how to use just the filtered data from a gridview in a chart.  Currently the chart is standard Silverlight control and not a Tererik control.  When the user sets various filters on a Telerik GridView,  I want to display just that filtered data in a chart.  Is it possible to iterate, or get a reference to a list (or array, or whatever) of just the rows that are being displayed?

Thanks,
Jeanne

10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 May 2009, 05:44 AM
Hi Jeanne,

Generally the grid Records property will respect filtering immediately - you can iterate records and build the chart with desired values. Similar example using only selected records can be found here:
http://demos.telerik.com/silverlight/#Chart/Integration/ChartAndGrid

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeanne
Top achievements
Rank 2
answered on 28 May 2009, 12:56 AM
I'm not having much luck with this.  Let's say the OperDataReport.ItemsSource has been set from the completed event of a web service.  No filter has been applied to the grid.  The user clicks on the tab to view the grid.  In the tab control's SelectionChanged event, I look at the count of the .Records as in:

OperDataReport.Records.Count()   <== OperDataReport is the grid

and it says there are 0 records (this should be 125 - the total number of records in the ItemsSource).  I try setting a filter in the grid and move back to the chart.  Now the above line says there is 1 record - but I want it to tell me there are 111 records that passed the filter requirement. 

What am I doing wrong?

Thanks,
Jeanne


0
Hristo Deshev
Telerik team
answered on 30 May 2009, 11:09 AM
Hi Jeanne,

I am not sure what is happening, but I am unable to reproduce this problem. The Records property contains records for the respective data items. Note that if the grid is grouped Records will contain GroupRecord objects that in turn may contain group record or data record objects.

I am attaching my test project for your reference. Can you reproduce the problem there, or open up a support ticket to submit a project?

All the best,
Hristo Deshev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeanne
Top achievements
Rank 2
answered on 02 Jun 2009, 11:39 PM
Hi,

That's the problem - it is filtered.  I need column totals and the only way I could figure out to do that was to filter the entire grid.

So now I am trying to get to the .RealRecords property which I can see is a Telerik.Windows.Data.RecordCollection, but I'm having trouble retrieving the data records.  Is there an example of that around anywhere?

Thanks,
Jeanne
0
Hristo Deshev
Telerik team
answered on 05 Jun 2009, 09:22 AM
Hello Jeanne,

The records returned by the Records property will always be filtered. To get an unfiltered view of your data, I would recommend that you use the collection that you passed as the ItemsSource value.

I am still not sure how you are trying to implement column totals using filtering. I can't connect those two features, and I don't think one can implement that easily. If it is any comfort, I want to inform you that we will ship column totals as a built-in feature for our Q2 2009 release.

Kind regards,
Hristo Deshev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeanne
Top achievements
Rank 2
answered on 05 Jun 2009, 07:30 PM
The problem is not the filter, but the grouping.  The grouping allows me to get column totals.  Now I need to loop through the records from a grouped, filtered gridview.  I have started another thread that better explains the situation - but I still can't get an answer.
0
Nick Wood
Top achievements
Rank 1
answered on 24 Feb 2010, 02:27 AM
Hi

The Records property no longer exists in the latest versions. how can we now bind to the filtered itemsource?

Please Help.
0
Vlad
Telerik team
answered on 24 Feb 2010, 07:05 AM
Hi,

You can use Items instead.

Sincerely yours,
Vlad
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
Nick Wood
Top achievements
Rank 1
answered on 02 Mar 2010, 01:00 PM
Hi.

I tried to get access to the GridView.Items as suggested from the RadGridView1.Grouped event and get the following error:

"Cannot change or check the contents or Current position of the QueryableCollectionView while Refresh is being deferred."
0
Vlad
Telerik team
answered on 05 Mar 2010, 08:02 AM
Hello,

Please use Dispatcher to access Items - I've attached small example for reference.

All the best,
Vlad
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.
Tags
GridView
Asked by
Jeanne
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Jeanne
Top achievements
Rank 2
Hristo Deshev
Telerik team
Nick Wood
Top achievements
Rank 1
Share this question
or