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

Filter string on template column bound by int

1 Answer 48 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Arsalan Ansari
Top achievements
Rank 1
Arsalan Ansari asked on 14 Jul 2010, 06:18 AM
i have a RadGrid with some template columns that are bound by a SQL relationship ID that i want to filter by the Name instead.

For example, my orders table is connected to the drivers table via the DriverID.  On the EditItemTemplate, i have a rad combo box that is linked to the list of drivers and the selectedvalue inserts the DriverID in the RadGrid but for the ItemTemplate, it is simply a label that displays the DriverName

However, Filtering only allows me to filter by DriverID, i want to be able to Filter by DriverName

How can i do this?

<telerik:GridTemplateColumn HeaderText="Driver" DataField="DriverID" SortExpression="Driver">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblDriver" Text='<%# Eval("DriverName") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="rcbDrivers" runat="server"
                                                             DataSourceID="sdsSelectDriversForRCB" 
                                                             DataTextField="DriverName" SelectedValue='<%# Bind("DriverID") %>'
                                                             DataValueField="DriverID">
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 16 Jul 2010, 07:21 AM
Hello Arsalan,

Attached is a small sample demonstrating how to achieve your requirement.

Hope it helps.

Greetings,
Tsvetoslav
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
Filter
Asked by
Arsalan Ansari
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or