Open Filtering Control Code behind

4 posts, 2 answers
  1. metealika
    metealika avatar
    3 posts
    Member since:
    Jan 2014

    Posted 16 Mar 2015 Link to this post

    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.
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Mar 2015 Link to this post

    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.

     
  3. metealika
    metealika avatar
    3 posts
    Member since:
    Jan 2014

    Posted 18 Mar 2015 in reply to Dimitrina Link to this post

    Thank you Dimitrina. This is what i need.
  4. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Mar 2015 Link to this post

    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.

     
Back to Top