adding programmatically created radgrid to dynamically created radgridwrapper

2 posts, 0 answers
  1. narendra
    narendra avatar
    19 posts
    Member since:
    Feb 2019

    Posted 02 Apr Link to this post

    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.

     

  2. Attila Antal
    Admin
    Attila Antal avatar
    376 posts

    Posted 05 Apr Link to this post

    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.
Back to Top