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

Statically & Dynamically defined RadGrid Columns

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 04 Feb 2016, 04:55 PM
Hi, 

I want to create a RadGrid that is statically defined in the ASPX with some columns defined.  But also want to add (generically or programmatically) additional columns to the RadGrid (to the right of the already defined columns) dynamically based on the result set returned from a stored procedure. Finally, I want all columns to have full filter/sorting capabilities.

Is there a way I can achieve this?

NOTE: In the past, I have already created a programmatically defined RadGrid (in a older version of the RadGrid) by defining the complete grid structure, filters, events etc. in the Page_Init event (which was a lot of work).  I would like to know if there are easier ways to achieve this now in the latest versions of the RadGrid? 

Kind Regards

Dan

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 09 Feb 2016, 01:06 PM
Hi Dan,

Your assumption is correct. Combining programmatically created columns with declaratively defined columns in the mark-up is not supported. Please create the entire grid in the code-behind during Page_Init:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/defining-structure/creating-a-radgrid-programmatically#creating-the-grid-entirely-in-the-code-behind

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or