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

RadGrid CheckList Filtering not working when more than one option checked

5 Answers 308 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ck
Top achievements
Rank 1
ck asked on 27 Jan 2015, 05:50 PM
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
<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

5 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 30 Jan 2015, 11:39 AM
Hello,

I tried to replicate the behavior you describe, however I was unable to. I am attaching a sample project I used for testing. It is working as expected on my end. Give it a try and let me know if I am missing something.

Regards,
Viktor Tachev
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.

 
0
Calvin
Top achievements
Rank 1
answered on 16 Mar 2015, 02:08 AM
I am having the same problem as the post opener.

Whenever I checked 2 options in the filterchecklist, the filtering doesn't work properly.
0
Viktor Tachev
Telerik team
answered on 17 Mar 2015, 03:23 PM
Hi Calvin,

I tested the behavior and it is working as expected on my end. I made a short video as reference. It is available here.

Take a look at the video and let me know if I am missing something. I would also appreciate it if you can describe what should be modified in the sample from my previous post in order to replicate the behavior that you are seeing.

Regards,
Viktor Tachev
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.

 
0
Calvin
Top achievements
Rank 1
answered on 18 Mar 2015, 02:48 AM
Hi,

For my case is resolved by one of your colleague yesterday.

It is due to a bug in the control where it doesn't support when I set EnableLinqExpressions="false" 

After I changed it to true then it works like charm.

But hope you can look into the issue on this attributes and resolve in the next release.

Thanks.
0
Viktor Tachev
Telerik team
answered on 20 Mar 2015, 01:37 PM
Hi Calvin,

I am glad that you have found a workaround for the issue.

The developers are currently working on the bug you are referring to. The fix should be included in the next official release. Please download the next release and see how it works for you.

Regards,
Viktor Tachev
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.

 
Tags
Grid
Asked by
ck
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Calvin
Top achievements
Rank 1
Share this question
or