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

Open Filtering Control Code behind

3 Answers 162 Views
GridView
This is a migrated thread and some comments may be shown as answers.
metealika
Top achievements
Rank 1
metealika asked on 16 Mar 2015, 09:18 PM
Hi,
How can i open the filtering control popup for a given column code behind?

For example,
private void ShowFilteringControl(GridViewDataColumn column)
{
    myFilteringControl = new ????;
    myFilteringControl.Show();
}

or, something like that?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 18 Mar 2015, 10:12 AM
Hi,

The FilteringControl is a Popup and it is shown on the screen over RadGridView control. GridViewColumns do not expose a method to open the filtering control from code behind instead of waiting for a user interaction.

You can still find the instance of the specific Popup and try implementing any modifications yourself.

For example:

private void grid_Loaded_1(object sender, RoutedEventArgs e)
{
    this.Dispatcher.BeginInvoke(new Action(() => this.FindPopups()));
}
  
private void FindPopups()
{
    foreach (var headerCell in this.myGrid.ChildrenOfType<GridViewHeaderCell>())
    {
        var popUp = headerCell.ChildrenOfType<Popup>().FirstOrDefault();
  
       // do any modification on the Popup itself
    }
}


Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
metealika
Top achievements
Rank 1
answered on 18 Mar 2015, 11:03 AM
Thank you Dimitrina. This is what i need.
0
Accepted
Dimitrina
Telerik team
answered on 19 Mar 2015, 03:56 PM
Hi,

On a side note, you can also try the following approach by finding the respective FilteringDropDown element and setting its property IsDropDownOpened to True:
private void Button1_Click(object sender, RoutedEventArgs e)
{
    clubsGrid.ChildrenOfType<FilteringDropDown>().First().IsDropDownOpen = true;
}

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
metealika
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
metealika
Top achievements
Rank 1
Share this question
or