RadGrid Filtered Collection

2 posts, 0 answers
  1. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 30 Dec 2009 Link to this post

    Hello

    I was wondering if someone knows of a way to retreive the itemsource of a RadGrid when you apply a filter on it

    For exemple, you set the itemsource of radgrid1 at runtime start, you apply any filter on a column, and then, during the filtered event, you retreive a new collection containing only the items matching the filtering conditions.

    I'm trying to find a way to apply filtering on the ChartAggregate Example, to make my graph updates both on grouping and filtering event.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 30 Dec 2009 Link to this post

    Hi Subileau Pascal,

    In the Filtered event handler, you can read the grid's Items collection. It will give you the currently present data items, i.e. without the filtered out ones. Something like this:

    void clubsGrid_Filtered(object sender, Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs e)
    {
        StringBuilder currentValues = new StringBuilder();
        foreach (var dataItem in this.clubsGrid.Items)
        {
            currentValues.Append(dataItem.ToString() + ", ");
        }
        Debug.WriteLine(currentValues.ToString());
    }

    Let us know if this is not what you need.

    All the best,
    Ross
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top