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

"xxx items in xx pages" message at footer

2 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vishal
Top achievements
Rank 1
vishal asked on 09 Jul 2014, 11:23 AM
Hello,

I have applied paging on my grid and getting message "xxx items in xx pages".

Now when applying filters, if the items are displayed in only one page, the grid automatically removes the paging controls and messages, I want the grid to remove paging controls but not the message.

Is there any way, we can achieve that?

Thank you!
Vishal

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jul 2014, 12:03 PM
Hi Vishal,

In order to have the pager item to be shown set AlwaysVisible property of the PagerStyle to true .

ASPX:
<telerik:RadGrid ID="rgrdSample" runat="server">
   <PagerStyle AlwaysVisible="true" />
       <MasterTableView >

Thanks,
Shinu
0
Jayesh Goyani
Top achievements
Rank 2
answered on 09 Jul 2014, 08:39 PM
Hi,

Please try with the below code.

ASPX
<div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowFilteringByColumn="true"
        AllowPaging="true" PageSize="2" OnNeedDataSource="RadGrid1_NeedDataSource">
        <PagerStyle AlwaysVisible="true" />
        <MasterTableView>
            <RowIndicatorColumn Visible="False">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Created="True">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="ID" UniqueName="ID" HeaderText="ID">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</div>

ASPX.CS
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    dynamic data = new[] {
      new { ID = 1, Name ="name1"},
      new { ID = 2, Name = "name2"},
      new { ID = 3, Name = "name3"},
      new { ID = 4, Name = "Name4"},
       new { ID = 5, Name ="name5"}};
    RadGrid1.DataSource = data;
}
 
protected void Page_PreRender(object sender, EventArgs e)
{
    if (RadGrid1.PageCount == 1)
    {
        ScriptManager.RegisterStartupScript(this, this.GetType(), "test123", "$('.rgWrap').not('.rgInfoPart').css('display','none');", true);
 
    }
 
}


Let me know if any concern.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
vishal
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jayesh Goyani
Top achievements
Rank 2
Share this question
or