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

Filter not working in ItemTemplate Column in Grid

3 Answers 72 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Farhan
Top achievements
Rank 1
Farhan asked on 21 Oct 2011, 09:43 PM
Hi,
  I am stuck on a problem I need some help with, I have made a sample project to show the problem but I cant attach it here?.  This page has two grids, a parent grid showing Product Types and when you edit on any of the records it brings up the edit form with another grid showing the different types of product you wanted to edit. This grid in edit form has "inPlace" editing and I have used Item Template columns since i had to put required validators in for these fields since in my real project these are required fields. I noticed in the grid in the edit form the Filters are not working? I have tried to set the "autoPostbackonFilter" property to true, Can someone help me use these filters on the ItemTemplate columns? I have to use these since in my project in the grid in edit form there will be possibly many many items so the User needs the ability to filter? 

Please let me know of how to accomplish this, thanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 24 Oct 2011, 07:26 AM
Hello Farhan,

In order to enable filtering for TemplateColumns you should set DataField Property.

aspx:
<telerik:GridTemplateColumn DataField="EmployeeID" UniqueName="TemplateColumn">
   <ItemTemplate>
       <asp:Label ID="Label1" runat="server" Text='<%# Eval("EmployeeID") %>'></asp:Label>
   <ItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
Shinu.
0
Ashish
Top achievements
Rank 1
answered on 05 Aug 2014, 05:23 AM
Hi Shinu,
I add DataField property but still no working.

Thanks
0
Shinu
Top achievements
Rank 1
answered on 05 Aug 2014, 11:55 AM
Hi Ashish,

Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sqldsOrders" AutoGenerateColumns="false"
    AllowFilteringByColumn="True">
    <MasterTableView DataKeyNames="OrderID">
        <Columns>
            <telerik:GridTemplateColumn DataField="OrderID" FilterControlAltText="Filter Online column" HeaderText="TemplateColumn" UniqueName="TemplateColumn">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("OrderID") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Thanks,
Shinu.
Tags
Filter
Asked by
Farhan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Ashish
Top achievements
Rank 1
Share this question
or