RadGrid EnabledViewState=True, but NeedDataSource fires before PageIndexChanged

5 posts, 0 answers
  1. Trevor
    Trevor avatar
    6 posts
    Member since:
    Dec 2014

    Posted 03 Jul 2017 Link to this post

    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.

  2. Trevor
    Trevor avatar
    6 posts
    Member since:
    Dec 2014

    Posted 06 Jul 2017 Link to this post

    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.

  3. Eyup
    Admin
    Eyup avatar
    3990 posts

    Posted 06 Jul 2017 Link to this post

    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.
  4. Trevor
    Trevor avatar
    6 posts
    Member since:
    Dec 2014

    Posted 06 Jul 2017 in reply to Eyup Link to this post

    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.

  5. Eyup
    Admin
    Eyup avatar
    3990 posts

    Posted 11 Jul 2017 Link to this post

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