using 2014.3.1024.45. I am using a RadGrid with checklist filtering, nothing special. Wen two options from the listbox are checked, the radgrid doesn't filter properly, also when two or more columns are filtered at the same time. here's my markup
and my code behind
can anyone help please. I have been cracking my head with this for 2 hours now with no luck. thanks
<telerik:RadGrid ID=
"grdProjects"
runat=
"server"
AllowFilteringByColumn=
"True"
AllowSorting=
"True"
AutoGenerateColumns=
"False"
OnItemCreated=
"grdProjects_ItemCreated"
FilterType=
"CheckList"
GroupPanelPosition=
"Top"
ShowGroupPanel=
"True"
OnNeedDataSource=
"grdProjects_NeedDataSource"
AllowPaging=
"True"
ShowFooter=
"True"
CellSpacing=
"-1"
GridLines=
"None"
OnFilterCheckListItemsRequested=
"grdProjects_FilterCheckListItemsRequested"
>
<ClientSettings AllowDragToGroup=
"True"
ClientEvents-OnRowClick=
"openProject"
>
<Selecting AllowRowSelect=
"True"
/>
</ClientSettings>
<ItemStyle CssClass=
"popup-trigger"
/>
<AlternatingItemStyle CssClass=
"popup-trigger"
/>
<MasterTableView DataKeyNames=
"ProjectID,IsLead"
ClientDataKeyNames=
"ProjectID,IsLead"
>
<Columns>
<telerik:GridBoundColumn Visible=
"false"
DataField=
"ProjectID"
>
<ColumnValidationSettings>
<ModelErrorMessage Text=
""
></ModelErrorMessage>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Title"
AutoPostBackOnFilter=
"true"
CurrentFilterFunction=
"Contains"
FilterControlWidth=
"250"
HeaderText=
"Title"
UniqueName=
"Title"
DataType=
"System.String"
Aggregate=
"Count"
FooterText=
"Total Projects:"
>
<ColumnValidationSettings>
<ModelErrorMessage Text=
""
/>
</ColumnValidationSettings>
<ItemStyle Width=
"45%"
/>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn FilterControlAltText=
"Filter ResponsibleOfficerID column"
FilterCheckListEnableLoadOnDemand =
"true"
HeaderText=
"Responsible Officer"
UniqueName=
"ResponsibleOfficerID"
DataField=
"NAME"
SortExpression=
"Name"
>
<ItemTemplate>
<table style=
"width: 100%;"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td style=
"width: 40px;"
>
<img src=
"<%# Eval("
SThumbPath
") %>"
width=
"38px"
/></td>
<td nowrap=
"nowrap"
><%# Eval(
"NAME"
) %></td>
</tr>
</table>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText=
"Template"
UniqueName=
"TemplateName"
DataField=
"TemplateName"
FilterCheckListEnableLoadOnDemand=
"true"
FilterListOptions=
"VaryByDataType"
>
<ColumnValidationSettings>
<ModelErrorMessage Text=
""
></ModelErrorMessage>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText=
"Current Stage"
UniqueName=
"CurrentStage"
DataField=
"CurrentStage"
FilterCheckListEnableLoadOnDemand=
"true"
>
<ColumnValidationSettings>
<ModelErrorMessage Text=
""
></ModelErrorMessage>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText=
"Status"
UniqueName=
"Status"
DataField=
"Status"
DataType=
"System.String"
SortExpression=
"Status"
FilterCheckListEnableLoadOnDemand=
"true"
>
<ColumnValidationSettings>
<ModelErrorMessage Text=
""
></ModelErrorMessage>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
and my code behind
protected
void
grdProjects_FilterCheckListItemsRequested(
object
sender, GridFilterCheckListItemsRequestedEventArgs e)
{
string
DataField = (e.Column
as
IGridDataColumn).GetActiveDataField();
var ds = ProjectModel.GetAllProjects();
switch
(DataField)
{
case
"ProjectID"
:
e.ListBox.DataSource = ds.Select(p => p.ITCProjectID).OrderBy(p => p).Distinct().ToList();
break
;
case
"Title"
:
e.ListBox.DataSource = ds.Select(p => p.Title).OrderBy(p => p).Distinct().ToList();
break
;
case
"NAME"
:
e.ListBox.DataSource = ds.Select(p => p.NAME).OrderBy(p => p).Distinct().ToList();
break
;
case
"TemplateName"
:
var list = ds.Select(p => p.TemplateName).Distinct().ToList();
list.Add(
"Project Lead"
);
list = list.OrderBy(l => {
return
l; }).ToList();
e.ListBox.DataSource = list;
break
;
}
can anyone help please. I have been cracking my head with this for 2 hours now with no luck. thanks