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

Close a custom filter

4 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Edward
Top achievements
Rank 1
Edward asked on 05 Jan 2012, 06:19 PM
I created a custom filter.  I know that when you click outside of the filter control, it will close the filter.  I want to add a button that will close the filter control, but I didn't find anything.

4 Answers, 1 is accepted

Sort by
0
Edward
Top achievements
Rank 1
answered on 05 Jan 2012, 07:58 PM
I did this:

private void Image_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
    try
    {
        ((this.Parent as Control).Parent as System.Windows.Controls.Primitives.Popup).IsOpen = false;
    }
    catch (Exception)
    {
    }
}

For some reason ParentOfType<System.Windows.Controls.Primitives.Popup>() always return null.
0
Maya
Telerik team
answered on 06 Jan 2012, 07:35 AM
Hi Edward,

I would recommend you to run through this blog post for a reference. Does the solution there correspond to your requirements ? 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Chirag
Top achievements
Rank 1
answered on 22 Mar 2012, 12:20 PM
Hi Edward

Have you solve a close button issue in custom filter control 

Please provide some idea for that 
i am also face same kind of problem and post in telerik site but still not gating any solution if you have  please reply in your question or my question. 
My question link = http://www.telerik.com/community/forums/silverlight/gridview/close-custom-filter-control.aspx
0
Chirag
Top achievements
Rank 1
answered on 10 May 2012, 01:53 PM
hello 
i think this code can help you 
private void btnclose_Click(object sender, RoutedEventArgs e)
        {
            FilteringDropDown down = Telerik.Windows.Controls.UIElementExtensions.ParentOfType<FilteringDropDown>(this);
            if (down != null)
            {
                down.IsDropDownOpen = false;
            }
        }
Tags
GridView
Asked by
Edward
Top achievements
Rank 1
Answers by
Edward
Top achievements
Rank 1
Maya
Telerik team
Chirag
Top achievements
Rank 1
Share this question
or