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

RadGrid EnabledViewState=True, but NeedDataSource fires before PageIndexChanged

4 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 03 Jul 2017, 09:03 PM

It's as the title says.  I can't figure out what is causing this to occur.  The page in question has minimal changes made the past month, and these revolve around the addition of a new lookup control (based on RadComboBox) and some internal system logic unrelated to UI.  My understanding is that if ViewState is enabled on the control, then PageIndexChanged should fire before NeedDataSource, but it does not.

 

The end result is paging on a grid that worked a month ago no longer works.  It continues to load the first 15 records every time the page is changed.

 

Any thoughts?  I'm sorry, I can't provide code, because this issue isn't from a simple solution.  I'm mainly looking for ideas on how to debug/correct this that I haven't thought of.

4 Answers, 1 is accepted

Sort by
0
Trevor
Top achievements
Rank 1
answered on 06 Jul 2017, 01:37 PM

So, in the end, it turned out that somehow calling Page.FindControlByType<RadWindowManager>() (didn't even have to assign it to a variable and use it to cause this bug to occur - I tested this by adding/removing the above FindControlByType method call, and the bug would occur when this line was added, and it would not occur when this line was removed), would somehow cause RadGrid's build in paging to not function in some pages where our custom CompositeControl lookup control existed on the same page as a RadGrid.  Most pages like this worked fine.

 

We've worked around this for now by having the custom lookup control implement it's own RadWindowManager for now, instead of attempting to find/reuse any existing RadWindowManager that might exist on the page.  If anyone has any ideas on why Page.FindControlByType<RadWindowManager>() would cause this behavior, I'd love to hear them.

0
Eyup
Telerik team
answered on 06 Jul 2017, 02:37 PM
Hi Trevor,

I'm not sure about the reason for the problem in your specific scenario. Generally, you can find the event life cycle of the grid here:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/control-lifecycle/event-sequence 

Also, your CompositeControl may not contain Telerik controls, but note that inheriting controls is beyond our support scope, even when they are inherited directly from Telerik controls.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Trevor
Top achievements
Rank 1
answered on 06 Jul 2017, 02:44 PM

Just for reference, our LookupControl inherits from CompositeControl and implements a RadComboBox, some images/buttons based on configuration, a RadWindowManager, and RadWindows.  It's a quick lookup RadComboBox, with the images/buttons serving as controls to popup advanced search/add new/edit windows, and a clear selection button.

 

The solution is obviously a lot more complex than the above.  It was just really strange for Page.FindControlByType<RadWindowManager>(); to cause built in RadGrid paging to stop functioning on a couple of pages, but not most of them, which implemented RadGrids.

0
Eyup
Telerik team
answered on 11 Jul 2017, 06:13 AM
H Trevor,

I'm glad that you've managed to find a solution for your specific scenario, but I just want to repeat the general caveat here that using custom controls is beyond our support scope, even when they are inherited directly from Telerik controls. You can also try using UserControls for similar functionality in the future.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Trevor
Top achievements
Rank 1
Answers by
Trevor
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or