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

Populating a DataGrid with Dynamic Columns

2 Answers 603 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 02 Jul 2011, 02:45 PM
In this blog post the author describes populating a datagrid in a SilverLight application dynamically at runtime. I'm wondering how the same might be accomplished in a WPF application using RadGridView. Porting her solution shouldn't be too difficult I'm just not sure as to the XAML, in particular the item templates. Can some one offer some insight?  Thanks.

http://msmvps.com/blogs/deborahk/archive/2011/01/23/populating-a-datagrid-with-dynamic-columns-in-a-silverlight-application-using-mvvm.aspx

2 Answers, 1 is accepted

Sort by
0
Frank McGuire
Top achievements
Rank 1
answered on 22 Nov 2011, 06:00 PM
We also are in need of a WPF solution for Populating a RadGridView with Dynamic Columns.  Is there a Telerik WPF RadGridView example for accomplishing this?   The scenario we are presented with is we have to support a known/fixed number of columns from an object data source.  This data source also needs to support "dynamic columns" which in our case, are additional data fields added to the underly data source.  We need to be able to support additional fields being added to a data table in the underlying database and then those fields being dynamically added to the data source object and available for populating a RadGridView. 
Any suggestions on how to support two way binding to a variable number of rows and columns would be greatly appreciated!
Thanks.
0
Vlad
Telerik team
answered on 23 Nov 2011, 07:38 AM
Hello,

 You can check this demo for more info about dynamic binding:
http://demos.telerik.com/silverlight/#GridView/DataSources

And this blog post:
http://blogs.telerik.com/vladimirenchev/posts/11-09-28/dynamic-binding-for-your-silverlight-applications.aspx

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Pete
Top achievements
Rank 1
Answers by
Frank McGuire
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or