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

Allow paging is not working

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Asif
Top achievements
Rank 1
Asif asked on 24 Sep 2010, 02:15 PM
Hi,
        Allow paging is not working in radgrid. Please check the code below:
<radW:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007">
</radW:RadWindowManager>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<radspl:RadSplitter Width="100%" Height="100%" ID="RadSplitter1" runat="server" 
Orientation="Horizontal" Skin="Office2007" VisibleDuringInit="false">
<radspl:RadPane ID="RadPane1" runat="server" Height="167" MinHeight="79">
  
<radG:RadGrid ID="RadGrid1" runat="server" PageSize="5" AllowSorting="true"
EnableAJAXLoadingTemplate="true" AllowPaging="true" AutoGenerateColumns="False" EnableAJAX="True"
GridLines
="None" Skin="Office2007">
<AJAXLoadingTemplate>
 <asp:Panel ID="Panel1" Width="100%" Height="100%" runat="server">
   <img src="Images/Loading.gif" style="z-index: 100" />
 </asp:Panel>
</AJAXLoadingTemplate>
<ExportSettings IgnorePaging="True" OpenInNewWindow="True" />
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView DataKeyNames="ID" AllowPaging="true" AllowSorting="true">
 <Columns>
   <radG:GridBoundColumn DataField="ID" UniqueName="ID" Display="false">
   </radG:GridBoundColumn>
   <radG:GridBoundColumn DataField="Name" UniqueName="Name">
   </radG:GridBoundColumn>
 </Columns>                                    
</MasterTableView>
<ClientSettings ApplyStylesOnClient="True" EnableClientKeyValues="True">
  <Selecting AllowRowSelect="True" />
  <ClientEvents OnGridCreated="GridCreated" OnRequestStart="GridRequestStart" 
OnRowContextMenu="ContextMenu" />
</ClientSettings>
</radG:RadGrid>
  
</radspl:RadPane>
</radspl:RadSplitter>

Note: im using classic radgrid.

Please find me the solution as soon as possible.

Thanks in Advance.

Regards,
Asif





1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Sep 2010, 08:23 AM
Hello Asif


From the given code, I assume that you are using Simple DataBinding technique which can be used in simple scenarios which does not require complex operations on grid. Keep in mind that if you choose simple data-binding, you will need to assign data-source and rebind the grid after each operation (paging, sorting, editing, etc.) - this copies exactly MS DataGrid behavior.

You need this code for Paging to work:
protected void RadGrid1_PageIndexChanged(object source, Telerik.WebControls.GridPageChangedEventArgs e)
{
    LoadData(); // For populating grid
}


A better option is using advanced data-binding through its NeedDataSource event or data source control.
Advanced data-binding


-Shinu.
Tags
Grid
Asked by
Asif
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or