Gridview Row Count after filtering

6 posts, 0 answers
  1. Dameion Bryan
    Dameion Bryan avatar
    2 posts
    Member since:
    Sep 2009

    Posted 24 Jun 2010 Link to this post

    How do I determine the number of rows in a RadGridView after the items have been filtered.

    On my view I have the following binding code on a textblock, which does get the count of the rows that are loaded into the grid, but the rowcount is not updated when the grid is filtered.

    Text

     

     

    ="{Binding ElementName=StoreMaintenanceGridView, Path=Items.Count, Mode=OneWay}"

     


    I have seen in the asp grid control where there is a "MasterTableView" object associated with the GridView that allows you to retreive this information, yet that isn't available in Silverlight.

    Thanks in Advance.

  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 25 Jun 2010 Link to this post

    Hi Dameion Bryan,

    Currently the Items collection does not raise PropertyChanged events for its Count property.

    You can workaround the current limitation by updating the text manually:

    public MainPage()
    {
        InitializeComponent();
      
        this.clubsGrid.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
    }
      
    void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    {
        this.countText.Text = this.clubsGrid.Items.Count.ToString();
    }


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Jani
    Jani avatar
    61 posts
    Member since:
    Jan 2008

    Posted 15 Apr 2011 Link to this post

    This Issue is still open.
    The suggested workaround is not applicable in our MVVM solution.
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 18 Apr 2011 Link to this post

    Hello Jani,

    The issue has been resolved. RadGridView.Items will raise PropertyChanged for the Count property.

    You can give it a try with one of the latest versions, for example 2011 Q1.

    Regards,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Adhi
    Adhi avatar
    2 posts
    Member since:
    Sep 2014

    Posted 21 Nov 2014 in reply to Rossen Hristov Link to this post

    Hi - Could you please post the implementation of filter count? Please include Xaml code and event to handle.


    Thank you very much !!!
  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Nov 2014 Link to this post

    Hello,

    We improved this functionality and now you can get the correct items count by directly binding to the Count property of RadGridView's Items collection.
    For example:
    <TextBlock Text="{Binding ElementName=clubsGrid, Path=Items.Count, Mode=OneWay}"/>

    Would you please try with our latest version and let me know the result?

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner