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

How can I turn on the filtering funnel icon?

4 Answers 34 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerry Kurata
Top achievements
Rank 1
Jerry Kurata asked on 21 Apr 2011, 04:33 PM
Hi,

I have a custom filter dialog through which the user enters filter criteria.  Based on this criteria I perform my own filtering of the underlying itemsource for the grid.  I would like to turn on the funnel icon for the columns the user has used to filter the data.  Can someone show how I can do this?

Thanks,

Jerry

4 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 21 Apr 2011, 05:15 PM
Hello Jerry Kurata,

 You need to add a ColumnFilterDescriptor for each column to the RadGridView.

Greetings,
Yavor Georgiev
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
0
Jerry Kurata
Top achievements
Rank 1
answered on 21 Apr 2011, 05:38 PM
Yavor,

So the ColumnFilteringDescriptor is required even if I am doing the filtering (via Linq) in other parts of my code?  If so, I assume that the descriptor would be initialized, but none of the .FieldFilter values would be set.  Is that correct?

Thanks,

jerry


0
Accepted
Yavor Georgiev
Telerik team
answered on 21 Apr 2011, 06:19 PM
Hi Jerry Kurata,

 I apologize for misunderstanding your question. If you already apply filtering externally, you only need to handle the CellLoaded event like so:
void gridView_CellLoaded(object sender, CellEventArgs e)
{
    var cell = e.Cell as GridViewHeaderCell;
    if (cell != null && cell.Column.UniqueName == "UnitPrice")
    {
        if (cell.DataColumn.FilteringControl == null)
        {
            cell.DataColumn.FilteringControl = new FilteringControl();
        }
 
        this.Dispatcher.BeginInvoke(() => cell.DataColumn.FilteringControl.IsActive = true));
    }
}


Regards,
Yavor Georgiev
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
0
Jerry Kurata
Top achievements
Rank 1
answered on 21 Apr 2011, 10:28 PM
Thanks Yavor.  Your code worked great!
Tags
GridView
Asked by
Jerry Kurata
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Jerry Kurata
Top achievements
Rank 1
Share this question
or