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

Radgrid filtering not working as expected

1 Answer 9 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Garrett
Top achievements
Rank 1
Garrett asked on 08 Oct 2013, 03:25 PM
Hi hi :)

I have a column in a grid:

<telerik:GridDropDownColumn DataField="CustomerID" DataType="System.String" DataSourceID="SqlDataSource4" FilterControlAltText="Filter CustomerName column" HeaderText="Customer Name" ListTextField="Name" ListValueField="ID" SortExpression="Name" UniqueName="CustomerName">
                            <ColumnValidationSettings>

using this data source:

<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:NameOfString %>" SelectCommand="SELECT [Name], [ID] FROM [Customer] ORDER BY [Name]"></asp:SqlDataSource>

I want to be able to filter the grid by Name, but it filters by ID for some reason. Here's what I mean:

if I filter by name this happens:

http://i.imgur.com/F3lJxnN.png

if I filter by Gretchen's ID, this happens:

http://i.imgur.com/qkz96vj.png


So it is filtering by the wrong field but I think I have the settings correct, yes?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 09 Oct 2013, 04:03 AM
Hi Garrett,

You have set DataField="CustomerID",hence the filtering is based on CustomerID,if you have to filter by CustomerName, you have to set the DataField="CustomerName". Filtering is done on the DataField.
Please make the changes and see if the filtering works,let me know if any concern.

Thanks,
Princy
Tags
Grid
Asked by
Garrett
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or