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

Open Filter Dialog from Context Menu

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 30 Aug 2011, 03:38 PM
Telerik Team,

I have created a custom context menu based on the examples you provided.  (Easy to follow... thanks!)  However, we would like to include an option to spawn the standard filter dialog from within the context menu for completeness.  Is there way to open the filter dialog programmatically (in the correct/normal position) if we know exactly which column we want to open it for?
 
I see how to create a custom filter dialog, etc.  But we really just want to spawn the normal one on demand from the context menu.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 31 Aug 2011, 12:44 PM
Hello Tim,

Yes, there is a way. You can try this:

private void Button1_Click(object sender, RoutedEventArgs e)
{
    var nameHeaderCell = this.clubsGrid
        .ChildrenOfType<GridViewHeaderCell>()
        .Where(headerCell=>headerCell.DataColumn.UniqueName == "Name").FirstOrDefault();
      
    if (nameHeaderCell != null)
    {
        var f = nameHeaderCell.ChildrenOfType<FilteringDropDown>().FirstOrDefault();
        if (f != null)
        {
            f.IsDropDownOpen = true;
        }
    }
}

You will substitute the hard-coded "Name" of course.

Let me know if this does not help.

Kind regards,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or