В моем RadGrid я использую FilterType = «Комбинированный», и я привязываю фильтр вниз, используя метод FilterCheckListItemsRequested. Мой код выглядит следующим образом:Как уменьшить параметры фильтра в radgrid при применении большего количества фильтров
protected void rgCallRecordings_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
{
// Get the list of calls stored in session
var results = (IQueryable<DC_CR_RECORDING>)Session["CallRecordings"];
// Get the column name
string dataField = (e.Column as IGridDataColumn).GetActiveDataField();
// Get the filter expression of the grid
string filterExpression = rgCallRecordings.MasterTableView.FilterExpression;
// Initialise new list
IEnumerable<DC_CR_RECORDING> DistinctList = new List<DC_CR_RECORDING>();
// Depending on which column it is change the data output.
switch (dataField)
{
case "SCRIPT_AGENT":
// Seperate the script agents from the call recordings
DistinctList = results.GroupBy(s => s.SCRIPT_AGENT).Select(group => group.First());
break;
case "CLIENT_NAME":
// Seperate the Client name from the call recordings
DistinctList = results.GroupBy(s => s.CLIENT_NAME).Select(group => group.First());
break;
case "CLIENT_REF_NUMBER":
// Seperate the Client name from the call recordings
DistinctList = results.GroupBy(s => s.CLIENT_REF_NUMBER).Select(group => group.First());
break;
case "CLIENT_LINK_REF":
// Seperate the Client link reference from the call recordings
DistinctList = results.GroupBy(s => s.CLIENT_LINK_REF).Select(group => group.First());
break;
case "SCRIPT_TYPE":
// Seperate the call direction from the call recordings
DistinctList = results.GroupBy(s => s.SCRIPT_TYPE).Select(group => group.First());
break;
case "SCRIPT_RESULT":
// Seperate the call direction from the call recordings
DistinctList = results.GroupBy(s => s.SCRIPT_AGENT).Select(group => group.First());
break;
}
Я пытаюсь обновить параметры фильтра каждый раз, когда новый фильтр применяется поэтому список опций отображаются только элементы, которые присутствуют в отфильтрованной сетке. Я попытался получить выражение фильтра при применении фильтра, но я не уверен, как применить его к набору результатов.