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

[Solved] RadGrid Paging Issue when used in Grid having dynamic GridColumns

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Deepa
Top achievements
Rank 1
Deepa asked on 10 Jul 2013, 03:07 AM
  1. Grid is defined in markup
  2. But the grid columns are added dynamically after the data is fetched from database onNeedDataSource
  3. I had to set the EnableViewState to false since the grid columns are created dynamically
  4. When a different page in the grid is selected, Grid.PageIndex is always returning 0 even when the paging is enabled. Why?
  5. To solve the above issue, I tried to add OnPageIndexChanged event to the grid. But this event is never getting called when a different page is selected in grid. Why? Does this not work when ViewState is disabled?
Can you please explain how to make the PageIndex to return the appropriate page selected?

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 15 Jul 2013, 06:53 AM
Hi,

As this help article says you should create the structure of RadGrid inside the Page_Load event. In this case you may leave the ViewState enabled. You could also check this help topic for more information on how to change the structure of RadGrid dynamically on postback.

About the problem you are observing could you share your full page source code along with the code-behind file content? Thus all the people who want to help you will have better understanding of your case.

Regards,
Andrey
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Deepa
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or