Filter not working in ItemTemplate Column in Grid

4 posts, 0 answers
  1. Farhan
    Farhan avatar
    39 posts
    Member since:
    Aug 2011

    Posted 21 Oct 2011 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Oct 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashish
    Ashish avatar
    2 posts
    Member since:
    Aug 2014

    Posted 05 Aug 2014 Link to this post

    Hi Shinu,
    I add DataField property but still no working.

    Thanks
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2014 in reply to Ashish Link to this post

    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.
Back to Top