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

adding programmatically created radgrid to dynamically created radgridwrapper

1 Answer 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
narendra
Top achievements
Rank 1
narendra asked on 02 Apr 2019, 04:47 PM

In my asp.net application i programmatically create radgrid and add i to div and display it. 

now i would like to add programmatically created radgrids to radgridwrapper. (now i would like to programmatically create radgridwrapper and add radgrids to it.)

Can anyone please let me know how to do this in c#?

later i would like to export radgridwrapper to excel / csv. finding it difficult to export groups of radgrids to multiple excel sheets with my Telerik version 2017.2.503.40

i don't want to upgrade my telerik version as of now.

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 05 Apr 2019, 03:02 PM
Hi Narendra,

We have an article that describes various ways for creating RadGrid programmatically and I would recommend taking a look and eventually follow the instructions. It has several examples that you can try. I actually recommend the one describing the steps for Creating a RadGrid on Page_Init

In your case, I would recommend using an ASP Panel instead of a GenericHTML control as that also renders as a DIV but its a server controls and you can adjust it more than you would do with a Generic HTML element. Create the panel object add it to the page, then create the grid objects and add them to the Panel. All these in the Page_Init event.

We have samples for exporting RadGrid in multiple sheets here: Multiple worksheets in ExcelML. Another example here: ThreeRadGridsExport

Also there is an article for exporting multiple RadGrid controls into a single file here: Export multiple RadGrids in single PDF/Excel file. In your case, however, you would like to do that in different sheets. 

I hope these articles will help you implement the required behavior.

Kind regards,
Attila Antal
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
narendra
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or