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

Cascading Filters for the HeaderContextMenu

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 01 Jun 2016, 08:21 PM

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? 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 06 Jun 2016, 11:31 AM
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.


Regards,
Konstantin Dikov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or