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

How to use GridDropDownColumn

4 Answers 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stavros
Top achievements
Rank 1
Stavros asked on 25 Nov 2008, 10:18 AM
I want to use the GridDropDownColumn in the edit form of a grid in a way that it gets its values from a table with two columns (product_id, product_name) but the user sees only the product name.
The insert or update command should enter to another table I use only the product_id values.
Thank you very much!

4 Answers, 1 is accepted

Sort by
0
Stavros
Top achievements
Rank 1
answered on 25 Nov 2008, 12:34 PM
If I was not so clear about something please let me know.
Thanks again all for your help.
0
Stavros
Top achievements
Rank 1
answered on 25 Nov 2008, 02:50 PM
I tried to use it using this link : http://www.telerik.com/help/aspnet-ajax/grdcolumntypes.html

but I get the following error :

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'product_id'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'product_id'.
0
Stavros
Top achievements
Rank 1
answered on 25 Nov 2008, 10:59 PM
Here is the code I am using :

<telerik:GridDropDownColumn HeaderText="product_name" HeaderButtonType="TextButton" 
     UniqueName="DropDownListColumn" 
     ListTextField="product_name" 
     ListValueField="product_id" 
     DataSourceID="SqlDataSource10" 
     DataField="product_id" 
     DropDownControlType="RadComboBox" 
     AllowSorting="true">  
</telerik:GridDropDownColumn> 
0
Nikolay Rusev
Telerik team
answered on 26 Nov 2008, 01:02 PM
Hello Stavros,

Attached to this post you will find sample application using GridDropDownColumn. Please review the code.
You can also visit the link below as another example of all RadGrid column types:
Column types

Greetings,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Stavros
Top achievements
Rank 1
Answers by
Stavros
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or