"xxx items in xx pages" message at footer

3 posts, 0 answers
  1. vishal
    vishal avatar
    11 posts
    Member since:
    Jul 2014

    Posted 09 Jul 2014 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jul 2014 in reply to vishal Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 09 Jul 2014 in reply to Shinu Link to this post

    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
Back to Top