Cascading Filters for the HeaderContextMenu

2 posts, 0 answers
  1. Steven
    Steven avatar
    8 posts
    Member since:
    Mar 2012

    Posted 01 Jun 2016 Link to this post

    I currently use the HeaderContextMenu to filter a RadGrid and I've been asked if the column filters can cascade off one another (i.e. Selecting a two Divisions will reduce the available options in the State context filter to only those states in the selected Divisions).  I've seen (and completed) examples using standard Drop Downs on a RadGrid, but not with the HeaderContextMenu.  Is there a way to access the selected items to include with the selectCommand for the grid?  Is there another way to handle this? 

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 06 Jun 2016 Link to this post

    Hello Steven,

    With the new Excel-like filtering (through the HeaderContextMenu) you could achieve the desired result within the OnFilterCheckListItemsRequested event, where you could get the list with the selected values in the already filtered columns in the following manner:
    protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        string[] selectedDivisions = (sender as RadGrid).MasterTableView.GetColumn("Divisions").ListOfFilterValues;

    Once you get the checked values in the other columns you could filter the data before setting it to the ListBox.

    Hope this helps.

    Konstantin Dikov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top