This is a migrated thread and some comments may be shown as answers.
Programmatic multiple grid loading problem
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
Kannan
Top achievements
Rank 1
Kannan asked on 22 Oct 2011, 01:04 PM
Hi,

I have to create multiple grids dynamically with dynamic columns.(Grid genereated at code behind C#). I have created columns in onInit event of radgrid.I have two buttons outside the grid which is used to display and hide columns when clicked on that. In this scenario when i click any of the button it should hide some columns and show other columns for eg (if i click the second button it should hide first 5 columns and show next 5 columns. Initially the first 5 columns only shown on load other 5 are hidden).

The whole grid was created and all the maniplations are done in an ASCX file. This Control file is referred and created multiple times as per the requirement.

This control works fine if it has created for only one time. But i get some problems when it created more than once.

The problem is when i click on the button the grid needdatasource function should not be called, since i am using private function to hide and show columns and no grid rebind method or any thing related to ribind is written. But the problem when i have two or more grids the grid needdatasource method is fired and then creates the loads some unrelavent data. Eg (Binds some other grid data to some other grid and viseversa)

Please help me in this regards.

Kannan

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 26 Oct 2011, 01:10 PM
Hello Kannan,

Please ensure that you are creating the programmatic RadGrid correctly in PageInit event. Please review the following online resources which elaborates on this matter:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/definingstructure/defaultcs.aspx
If this doesn't help please post your radGrid declaration and the related code behind so we could further research on the code and do our best to isolate the root cause of the issue.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Kannan
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or