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

Rebind() not updating pager

4 Answers 261 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mac
Top achievements
Rank 2
Mac asked on 30 Apr 2008, 03:24 PM
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.

4 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 30 Apr 2008, 04:30 PM
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
0
Mac
Top achievements
Rank 2
answered on 01 May 2008, 08:07 AM

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

Thanks
Mac
0
Henrique Duarte
Top achievements
Rank 1
Veteran
answered on 08 May 2008, 10:13 AM
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
0
Sebastian
Telerik team
answered on 08 May 2008, 10:16 AM
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
Tags
Grid
Asked by
Mac
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Mac
Top achievements
Rank 2
Henrique Duarte
Top achievements
Rank 1
Veteran
Sebastian
Telerik team
Share this question
or