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

Delegate Sorting and Grouping to Custom ICollectionView

3 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James Craig
Top achievements
Rank 1
James Craig asked on 28 Jun 2010, 04:54 PM
Hello,

I wish to bind RadGridView columns to entries in a dictionary using the following approach:

http://www.codeproject.com/Articles/36497/Binding-a-Silverlight-DataGrid-to-dynamic-data-via.aspx

It appears that the standard Silverlight DataGrid will delegate sorting and grouping to its ItemsSource, when that object implements ICollectionView.  Unfortunately, I can't make this work with RadGridView.  Does anyone know what steps I must take to have RadGridView delegate sorting and grouping operations to its ICV-implementing data source ?

Many thanks,

James

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 29 Jun 2010, 04:44 PM
Hi James Craig,

Could you please take a look at our Silverlight DataTable implementation. All data operations like sorting, filtering, etc will work out of the box when this DataTable is used - there is no need to have a custom ICollectionView implementation. 


Greetings,
Milan
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
James Craig
Top achievements
Rank 1
answered on 29 Jun 2010, 06:06 PM

Hello Milan,

Many thanks for replying.  The Silverlight DataTable is a great solution, but unfortunately the requirements I've been given demand a data source with more flexibility still.  I'm porting to Silverlight a WinForms app that makes extensive use of the ADO.NET DataSet that must work like so:

1) Fetch tabular data from a CMS: rows represent nodes, columns represent properties of those nodes (which can't be known until runtime).  The lightweight DataTable deals with this brilliantly.

2) Once the initial data has been fetched and bound to, the program should subscribe to update notifications from its server.  Upon hearing that a node has been added, it must add a new row to the grid.  Any new node might have aspects (property-groups, unknowable in advance) applied to it that no node in the grid currently has - thus the grid must 'grow' some extra bound columns.  In the WinForms app, this is handled by merging two DataSets: the additional columns/properties appear seamlessly in the Grid without a full re-bind.  The limitation of the lightweight DataTable is that I can't add columns to it after I've added data - I would need to create a new instance, and re-bind the grid, resulting in a poorer user experience.

Binding to a dictionary gives me full freedom to add/remove properties, at the cost of losing most grid functionality.  I was hoping that I could recover that with a suitable implementation of ICollectionView, but it seems each vendor's grid has a different approach to working with ICV objects.  I totally realise that the infrastructure just isn't provided by Silverlight to handle the above easily.  But if you know a workable solution to this problem I'd be extremely grateful to hear it :)

Best regards,

James

0
Milan
Telerik team
answered on 30 Jun 2010, 03:31 PM
Hello James Craig,

Unfortunately it will not be possible to support this scenario at the moment but when we introduce support for dynamic .net (expando objects) the situation should improve. Unfortunately it is still unclear when we will be able to introduce those improvements. 

At the moment the only possible way is to create a new DataTable when new data arrives. 

Thank you for your interest in our controls and I apologize that we are unable to offer an elegant solution.


Sincerely yours,
Milan
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
James Craig
Top achievements
Rank 1
Answers by
Milan
Telerik team
James Craig
Top achievements
Rank 1
Share this question
or