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

Rad Grid Filter Template

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kks
Top achievements
Rank 1
kks asked on 08 Sep 2010, 01:53 PM
Telerik,

in my radGrid i got a GridTemplate Column, which contain a Label Control.
this Label Carries combination of two feilds .  ( label.text = description + extended description )
because i required combination two feild values in a single column.
The Issue is now, i can't able to filter this GridTemplate  using rad grid's filter option.

I am tring to impliment filter Template on this gridTemplate Column.
can any body help me how to impliment this filter template. OR if any body have better suggesion for filtering this column ( other than this ), please send to me.

Code used for gridTemplate Column:
<telerik:GridBoundColumn DataField="description" HeaderText="Description" SortExpression="description"
    UniqueName="description" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="extendedDescription" HeaderText="Ext. Description"
    SortExpression="extendedDescription" UniqueName="extendedDescription" Display="false">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="description1" HeaderText="Description">
    <ItemTemplate>
        <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("description")& " - " & Eval("extendedDescription") %>'></asp:Label>
    </ItemTemplate>
    <FilterTemplate>
        <telerik:RadTextBox ID="RdTxtName" EmptyMessage="Search" runat="server" EmptyMessageStyle-Font-Italic="true"
            HoveredStyle-Font-Italic="true" Width="100%">
        </telerik:RadTextBox><asp:Button ID="btnFilter" runat="server" Width="20px" Text="" OnClientClick="return filterName()" />
    </FilterTemplate>
</telerik:GridTemplateColumn>

Thanks in Advance.
kks
 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 08 Sep 2010, 04:08 PM
Hello,

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

All the best,
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
kks
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or