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

Is it possible to put paging on commanditem of RadGrid.

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DragonBall
Top achievements
Rank 1
DragonBall asked on 30 Jan 2009, 06:25 AM
Is it possible to put paging on commanditem of RadGrid. can anbody provide me a sample code. thanx .

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Jan 2009, 07:02 AM
Hello Manuel,

I would suggest you to use a PagerTemplate rather than a CommandTemplate and then set the position of the Pager as shown below:
aspx:
 <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" AllowPaging="true" PageSize="3">
        <MasterTableView DataSourceID="SqlDataSource1" >     
 <PagerStyle Position="Top" /> 
 <PagerTemplate> 
      <asp:LinkButton ID="LinkButton1" CommandName="Page" CommandArgument="Next" runat="server">Previous</asp:LinkButton> 
          <asp:LinkButton ID="LinkButton3" CommandName="Page" CommandArgument="Prev" runat="server">Next</asp:LinkButton> 
  </PagerTemplate> 
     .... 

It is also possible to set the pager in the CommandITemTemplate, just that you have to set the CommandNames and CommandArguments for the buttons accordingly.
aspx:
 <telerik:RadGrid ID="RadGrid1" AllowPaging="true" PageSize="3" DataSourceID="SqlDataSource1"  runat="server" > 
   <MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay="Top"
      <CommandItemTemplate> 
       <asp:LinkButton ID="LinkButton1" CommandName="Page" CommandArgument="Next" runat="server">Previous</asp:LinkButton> 
          <asp:LinkButton ID="LinkButton3" CommandName="Page" CommandArgument="Prev" runat="server">Next</asp:LinkButton> 
      </CommandItemTemplate> 
        .... 

Thanks
Princy.
Tags
Grid
Asked by
DragonBall
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or