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

Filtering Child Tables

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick New
Top achievements
Rank 1
Rick New asked on 01 Oct 2010, 06:10 PM
Probably missing something simple here, but filtering is not working on a grid temple column containing a child table

<telerik:GridTemplateColumn  HeaderText="Country">
   <ItemTemplate>
       <asp:Literal ID="CountryLiteral" runat="server" Text='<%# Eval("Address.Country.Country1") %>' />
   </ItemTemplate>
</telerik:GridTemplateColumn>
Tables are: Company (PrimaryAddressID) > Address (CountryID) > Country.Country1 (country name) When attempting to filter the grid by the country name, there is no filtering taking place, error messages or any change in the grid at all. Thanks!

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 01 Oct 2010, 07:07 PM
Hello Rick,

When you're saying no filtering is going on for the country column, what are you referring to? Are you referring to the filter control or are you trying to apply a FilterExpression for that column?

Also, since you're using a TemplateColumn, you need to create your filtering functionality by adding it to the FilterTemplate, since the TemplateColumn doesn't have automatic filtering like the other columns.
0
Rick New
Top achievements
Rank 1
answered on 01 Oct 2010, 07:49 PM
Thank you for your reply.

Yes, no filtering is going on for the Country Column, the other column filters work fine. I am using the filter control.  

Filtering was enabled for the whole table, which I thought applied to all columns if not explicitly overridden in the template.  The County Template now has AllowFiltering = true explicitly set, but the filter is still not working.  

<telerik:GridTemplateColumn AllowFiltering="true"  HeaderText="Country">
      <ItemTemplate>
                <asp:Literal ID="CountryLiteral" runat="server" Text='<%# Eval("Address.Country.Country1") %>' />
        </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks.
0
Accepted
Pavlina
Telerik team
answered on 04 Oct 2010, 08:53 AM
Hello Rick,

To allow filtering in template columns, you need to set the DataField property of the template column to the field you want to use for filtering. Refer to the following help article for more information:
http://www.telerik.com/help/aspnet-ajax/grdimplementingfilteringfortemplatecolumns.html

Regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Rick New
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Rick New
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or