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

[Solved] Paging in multiple radGrids

3 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 16 Apr 2009, 11:44 AM
In my application I use 4 radGrids which are synchronised. Sorting and scrolling workd fine.

Now I need to use Paging in the "RadGrid ensemble".

What is the best way to implement paging in a ensemble of 4 RadGrids?

Thanks

Christian

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Apr 2009, 10:36 AM
Hi Christian,

You can use the same PageIndexChanged event for all the four Grids. Give a try the following code snippet in the PageIndexChanged event to achieve the desired scenario.

ASPX:
 
 
<telerik:radgrid id="RadGrid1" runat="server" onpageindexchanged="RadGrid1_PageIndexChanged" AllowPaging="True" PageSize="5" > 
 
 ...... 
 
<telerik:radgrid id="RadGrid2" runat="server"  onpageindexchanged="RadGrid1_PageIndexChanged"   AllowPaging="True" PageSize="5"
 
 ...... 
 
<telerik:radgrid id="RadGrid3" runat="server"  onpageindexchanged="RadGrid1_PageIndexChanged"   AllowPaging="True" PageSize="5"
 
  ...... 
 
<telerik:radgrid id="RadGrid4" runat="server"  onpageindexchanged="RadGrid1_PageIndexChanged"   AllowPaging="True" PageSize="5"
    
  ...... 


CS:
 
 
   protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e) 
    { 
        int currentIndex = e.NewPageIndex; 
        Paging(currentIndex); 
    } 
 
    private void Paging(int currentIndex) 
    { 
        RadGrid1.CurrentPageIndex = currentIndex; 
        RadGrid1.MasterTableView.Rebind(); 
 
        RadGrid2.CurrentPageIndex = currentIndex; 
        RadGrid2.MasterTableView.Rebind(); 
 
        RadGrid3.CurrentPageIndex = currentIndex; 
        RadGrid3.MasterTableView.Rebind(); 
 
        RadGrid4.CurrentPageIndex = currentIndex; 
        RadGrid4.MasterTableView.Rebind(); 
    } 


Thanks
Shinu
0
Christian
Top achievements
Rank 1
answered on 22 Apr 2009, 11:06 AM
Thanks, this works fine.

But how can I Show the Paging Information only in one RadGrid and not on all RadGrids?

Thanks

Christian
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Apr 2009, 11:28 AM
Hello,

You can hide the pager row for the remaining grids as shown in the code below:

c#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pager = (GridPagerItem)e.Item; 
            pager.Controls[0].Visible = false
 
        } 
    } 
   // similarly you can hide the pager row for other grids 

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