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

[Solved] ColumnFilter Not Filtering

5 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Satya Sahu
Top achievements
Rank 1
Satya Sahu asked on 17 Mar 2010, 10:54 AM
Hi Folks,

I have a RadGrid with few GridTemplateColumns.

i have applied the AllowFilteringByColumn="true"

But when i try its not filtering anything.

I can see the same data in my grid after selecting the filter content.

any help appreciated.

Thanks in Advance.

Thanks
Satya

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Mar 2010, 11:07 AM

Hello Satya,

Filtering is automatically supported for Template columns. To allow filtering in template columns, you need only do the following:

  1. Set the AllowFilteringByColumn property of the grid or table view to True.
  2. Ensure that the AllowFiltering property of the template column is True
  3. Set the DataField property of the template column to the field you want to use for filtering. 

Also checkout the following documentation for more information about this topic.

Implementing filtering for template/custom columns

-Shinu.

0
Satya Sahu
Top achievements
Rank 1
answered on 17 Mar 2010, 11:14 AM
Hi Shinu,

Thanks for your reply..

i ensured all the above things that you have mentioned...

Below is my aspx code...can you please let  me know where i have gone wrong...

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true" PageSize="10"  AutoGenerateColumns="false"
AllowFilteringByColumn="true" >
<MasterTableView EditMode="EditForms" ShowFooter="True">
<PagerStyle Mode="Slider"></PagerStyle>
<Columns>
<telerik:GridTemplateColumn HeaderText="Import/Export" HeaderStyle-HorizontalAlign="Center" ShowFilterIcon="false" >
<ItemTemplate>
    <asp:CheckBox ID="chkImport" runat="server"></asp:CheckBox>
    <%--<cc1:MutuallyExclusiveCheckBoxExtender ID="meceImport" runat="server" Key="Import" TargetControlID="chkImport">
    </cc1:MutuallyExclusiveCheckBoxExtender>--%>
    <asp:Label ID="ID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "intGroupMarkId") %>' visible="false"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Group Marking" SortExpression="vchGroupMarkingName" HeaderStyle-HorizontalAlign="Center" ShowFilterIcon="true"
 AutoPostBackOnFilter="false" AllowFiltering="true">
<ItemTemplate>
    <asp:Label ID="lblGroup" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "vchGroupMarkingName") %>'></asp:Label>
    <asp:HiddenField ID="hdnGroupMarkId" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "intGroupMarkId") %>' />
                    
</ItemTemplate>
</MasterTableView>
   <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                        
                       
                    </ClientSettings>
<HeaderStyle BackColor="Silver">
</HeaderStyle>
</telerik:RadGrid>
0
Satya Sahu
Top achievements
Rank 1
answered on 18 Mar 2010, 06:58 AM
Awaiting for the response Folks...


Regards
Satya
0
Accepted
Princy
Top achievements
Rank 2
answered on 18 Mar 2010, 10:11 AM
Hi,

From your column definition I have noticed that you havent set the DataField for the GridTemplateColumn.Please  set  the

ASPX:
 <telerik:GridTemplateColumn 
   DataField="Country" 
   HeaderText="Country"
 <HeaderStyle Width="30%" /> 
 <ItemTemplate> 
   <img src='Img/<%# Eval("Country") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/> 
   <%# Eval("Country") %> 
</ItemTemplate> 
</telerik:GridTemplateColumn>  


For more info on the same:
Implementing filtering for template/custom columns

Princy



0
Satya Sahu
Top achievements
Rank 1
answered on 18 Mar 2010, 10:15 AM
Thanks a lot Princy.

Got my issue fixed..

Regards
Satya sahu
Tags
Grid
Asked by
Satya Sahu
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Satya Sahu
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or