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

Combobox get id of gridview

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 09 Feb 2011, 07:20 PM

Requirements

RadControls version Asp.net Latest version
.NET version

framework 4.0
Visual Studio version

2010
programming language

Vb.net
browser support

all browsers supported by RadControls


Hello,

I added the radcombobox to my webpage, it filters nicely the input i give it from the database. Now i would like to get the id from the item the radcombobox selects. Like for example
Customer10 - 1
Customer50 - 2

Is there a way to add an invisible field to the combobox, where i can add the id and fetch it, but not show it to a user?

Thanks in advance,

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Feb 2011, 06:05 AM
Hello Ben,


Set the DataValueField for the RadComboBox to "id", which should be the field name from the data source to bind to the Value property. Now get value through the SelectedItem.Value property.
Databinding Overview
 
If you want to add one more fields, then make use of custom attributes.


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