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

[Solved] Example RadComboBox filter using numeric IDs w/ EntityDataSource

3 Answers 218 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 21 Sep 2009, 07:55 PM
Could someone please point me to an example that uses a numeric data ID and a string display value?  All of the samples I have found use string values for both.  I want to be able to have a RadComboBox in the FilterTemplate, show the display value in the ItemTemplate, and a dropdown in the EditItemTemplate.

My RadGrid is EntityDataSource backed.  The RadCombo column is a foreign key in the EDMX model.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Sep 2009, 03:31 PM
Hi James,

In Telerik RadGrid you can enable dropdown filters for GridBoundColumns (or those columns which inherit from GridBoundColumns like GridDateTimeColumn, GridNumericColumn, etc.) and GridTemplateColumns declaratively - just set AllowFilteringByColumn = true for the entire grid and define FilterTemplate for the columns in question.
Find more information in the following link:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
James
Top achievements
Rank 1
answered on 24 Sep 2009, 03:39 PM
I saw that example, but it doesn't address three things I am looking for:

1.  Using EntityDataSource for the GridView and for the drop down data sources needed to retrieve the text and value data
2.  Using a combination of int/string to bind the dropdown in the template (the example uses string/string)
3. Sorting - When sorting on the header, since the actual column is an int, the sort should utilize the data bound to the text and not the value

James
0
Pavlina
Telerik team
answered on 30 Sep 2009, 08:10 AM
Hello James,

GridTemplateColumn is filtering by its DataField and it could not be filtered by DataTextField of DropDownColumn if this field is not a part of RadGrid DataSource.
Please find attached a simple runnable application that demonstrates this behavior. Give it a try and let me know if it helps.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
James
Top achievements
Rank 1
Share this question
or