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

RadGrid Filtered Collection

1 Answer 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ludovic Gerbault
Top achievements
Rank 1
Ludovic Gerbault asked on 30 Dec 2009, 10:44 AM
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.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 30 Dec 2009, 12:50 PM
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.
Tags
GridView
Asked by
Ludovic Gerbault
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or