Display item count in Status Bar

8 posts, 0 answers
  1. Dasha
    Dasha avatar
    80 posts
    Member since:
    Aug 2010

    Posted 14 Jul 2011 Link to this post

    Dear Support,

    Is there a way I can display the item count in the Status Bar or the grid when paging is disabled?  When paging is enabled, theres a message such as " 91 items in 7 pages" (like here: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/groupby/defaultcs.aspx), but is there a way i can have it say something like "Displaying 91 items."?  I know I can make use of column aggregation, but I'm wondering specifically about the Status Bar.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Jul 2011 Link to this post

    Hello Dasha,

    One suggestion is you can get the total items count in item event and then set the count in prerender event. Here is the sample code that I tried which worked as expected.

    C#:
    int i;
    protected void RadGrid1_ItemEvent(object sender, GridItemEventArgs e)
    {
    if (e.EventInfo is GridInitializePagerItem)
    {
        i = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
    }   
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
         RadGrid1.StatusBarSettings.ReadyText = i.ToString() ;
         RadGrid1.MasterTableView.Rebind();
    }

    Thanks,
    Princy
  3. Dasha
    Dasha avatar
    80 posts
    Member since:
    Aug 2010

    Posted 18 Jul 2011 Link to this post

    Still can't get it to show up.  Could it be because I'm using Advance Databind?
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 21 Jul 2011 Link to this post

    Hello Dasha,

    Unfortunately the required functionality could not be achieved per your requirements. After Q1 2009 the StatusBar item was modified and it could only appear if you have paging enabled for the RadGrid control.
    Excuse us for any inconvenience this may lead. We will update our documentation to add this statement as soon as possible.


    Maria Ilieva
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  5. RAM SHAN
    RAM SHAN avatar
    3 posts
    Member since:
    Jul 2009

    Posted 29 Feb 2012 Link to this post

    I am looking for a similar functionality to show the total item count in the grid with out any paging. is that possible with Q2 2011 version of controls for radgrid. If not, any suggestions on alternative approaches that this can be achieved.

  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Mar 2012 Link to this post

    Hello,

    As I previously mentioned the required functionality could only be achieved in case the paging is enabled for the RadGrid control. So I would suggest you to enable the paging feature for the RadGrid control in order to show the item count status bar. 

    Greetings,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Daniel
    Daniel avatar
    28 posts
    Member since:
    Jul 2018

    Posted 12 Sep 2018 Link to this post

    I got the status bar to show without paging information by doing the following:

    .Pageable(page => page

        .PreviousNext(false)

        .Numeric(false)

     

    Now I get the status bar with how many items I have without showing the paging information which I don't need because my grid is scrollable.

  8. Daniel
    Daniel avatar
    28 posts
    Member since:
    Jul 2018

    Posted 12 Sep 2018 in reply to Daniel Link to this post

    I forgot one thing, in the .DataSource you need to set your PageSize to something you'll never reach since it seems to default to 10 items if you don't

    .DataSource(dataSource => dataSource
                        .Ajax()
                        .ServerOperation(false)
                        .PageSize(10000))

Back to Top