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

RAd Grind doenst rebind

6 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 09 Jan 2014, 02:56 PM
Hi all, my major proplem is, thjat after i updated telerik to the last version, the rebind doensnt work for some reason the code that used rebind stoped working what can i do.

Best Regards

6 Answers, 1 is accepted

Sort by
0
Carlos
Top achievements
Rank 1
answered on 09 Jan 2014, 03:46 PM
basically i had the values from the radgrid passed to a datatabel so i can use them other way.
It worked until i updated telerik, i basically had the Radgrid1.AllowPaging = true; Radgrid1.Rebind(); but it stopped working.

any thoughts or ideas?
0
Princy
Top achievements
Rank 2
answered on 10 Jan 2014, 05:49 AM
Hi Carlos,

Without your code its hard to identify the issue. Make sure you have bound the Grid using the Advanced Data-binding (using NeedDataSource event). Below is a sample code that uses Rebind(), please try the code snippet and see if it works.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="5" OnNeedDataSource="RadGrid1_NeedDataSource">
</telerik:RadGrid>
<asp:Button ID="Button1" runat="server" Text="Ignore Paging" OnClick="Button1_Click" />

C#:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
 dynamic data = new[] {
 new { ID = 1, Name = "Name1", Number=123},
 new { ID = 2, Name = "Name2", Number=234},
 new { ID = 3, Name = "Name3", Number=234},
 new { ID = 4, Name = "Name4", Number=456},
 new { ID = 5, Name = "Name5", Number=567},
 new { ID = 6, Name = "Name6", Number=567},
 new { ID = 7, Name = "Name7", Number=789},
 new { ID = 8, Name = "Name8", Number=896},
 new { ID = 9, Name = "Name9", Number=741}
 };
 RadGrid1.DataSource = data;
}
protected void Button1_Click(object sender, EventArgs e)
{
 RadGrid1.AllowPaging = false;
 RadGrid1.Rebind();
}

Thanks,
Princy
0
Carlos
Top achievements
Rank 1
answered on 10 Jan 2014, 09:42 AM
Hi all,

The table is bound, the:
RadGrid1.AllowPaging = false;
RadGrid1.Rebind();

Doesnt work anymore, what i found for some strange reason, that now i have to do:
RadGrid1.MasterTableView.AllowPaging = false;
RadGrid1.Rebind();

This worked, i dont know what happen of diferrent from before the last update, to now, but the back up still works the first way, with the update it doesnt.

Best regards
0
Princy
Top achievements
Rank 2
answered on 21 Jan 2014, 11:19 AM
Hi Carlos,

If you have enabled the Paging in the MasterTableView , you have to access it using the MasterTableView property:

ASPX:
<MasterTableView AllowPaging="true". .>

C#:
RadGrid1.MasterTableView.AllowPaging = false;

If you use in the RadGrid, you can use either one to access the Paging:

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true". . >

C#:
RadGrid1.AllowPaging = false;
  //OR
RadGrid1.MasterTableView.AllowPaging = false;

Thanks,
Princy
0
Carlos
Top achievements
Rank 1
answered on 21 Jan 2014, 12:21 PM
I noticed that,

the paggin wad on radgrid, the code worked until the last update of telerik, then to correct it it onlçy work if i did to mastertableview.
0
Pavlina
Telerik team
answered on 23 Jan 2014, 02:44 PM
Hi Carlos,

I tested accessing the grid pager both ways and it is working properly as you can see from the attached project. Give it a try and see what is the difference in your case.

Regards,
Pavlina
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
Carlos
Top achievements
Rank 1
Answers by
Carlos
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or