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

RadGridView for Unknown numbers (1-n ) Columns

1 Answer 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 17 Oct 2014, 07:18 PM
I have a requirment where User have a functionality for Add & Remove of Columns It will be 1 today and can go for N in Future. Like Show history from year 2011 to 2000 & it may show 3 columns for each year.

Now is is possible that I can have some Dictionary collection binding for GridView As I can't bind this to some object as i don't know how many columns will come in near future.

I've bind a RadHeaderContextMenu with is bind with a Command on this I've to do this Add Remove of Columns. What Kind of Object I should have for GridView Itemssource & how to Add / Remove these Columns ?
Please Help. 

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 21 Oct 2014, 11:30 AM
Hi,

RadGridView.Columns collection is an ObservableCollection<GridViewColumn> and it expects column instances.  As to defining the columns, you can find the Defining Columns help article on how to define a column in code behind. 

I would also suggest you checking the MyColumnsBindingBehavior.cs in ComboBox Column online demo.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Anand
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or