Rebind() not updating pager

5 posts, 0 answers
  1. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 30 Apr 2008 Link to this post

    Hi,

    I have a checkbox column in a grid with a delete button located in a commanditemtemplate.

    When the delete button is pressed, an ajax request is made and a serverside method is executed removing the each row where the checkbox is checked.

    Finally I rebind the grid and this in turn calls the NeedDataSource event of the grid which loads my data (minus the rows I deleted).

    So far so good, The rows I selected to delete are now gone from the grid, the only problem is the pager still shows the original record count (and if rows remaining are less than my pagesize, the wrong page number too)

    Am I missing something here or is this a bug?

    Thanks in advance
    Mac.
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 30 Apr 2008 Link to this post

    Hi Mac,

    We are aware of a similar problem which concerns the .Net3.5 web applications/web sites. Do you work in .Net2.0 or 3.5? If the latter, you can check if the disabling Linq expressions resolves the problem on your end. You need to set Grid's EnableLinqExpressions property to false.

    Let us know if this helps.

    Sincerely yours,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 01 May 2008 Link to this post


    I am using .Net 3.5 and setting EnableLinqExpressions to false seems to have done the trick. Pager now updates as expected.

    Thanks
    Mac
  5. Henrique Duarte
    Henrique Duarte avatar
    104 posts
    Member since:
    Oct 2003

    Posted 08 May 2008 Link to this post

    Hi Konstantin,

    I'm having problems to Rebind the grid too.
    If I'm on page 5 and call Grid.Rebind(), the pager still remains on page 5, but I want it back to page 1.
    Disabling the EnableLinqExpressions is not working for me.

    []'s!

    Henrique
  6. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 08 May 2008 Link to this post

    Hello Henrique,

    You need to reset the current page index for the grid before you invoke the Rebind() method to navigate back to the first page, namely:

    MyRadGrid.MasterTableView.CurrentPageIndex = 0;
    MyRadGrid.MasterTableView.Rebind();


    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017