I have added a RadControl, RadGrid and I need to add a radComboBox in the edit mode.
When user clicks on the radComboBox, I need to get both "text" and "value" of the radComboBox to save to table when user updates values.
<telerik:RadComboBox ID="RadComboBox1" Runat="server"
DataSourceID="SqlDataSource1" DataTextField="docCategoryName"
DataValueField="docCategoryID" Height="200px" Skin="Vista">
When user selects from the radComboBox, I need to get the value of DataTextField & DataValueField into a HiddenField.
Best Answer
The approach described by Program.X is very good. This, of course, works if you're using a RadCombobox inside of a GridTemplateColumn in RadGrid.
RadGrid also provides a built-in
GridDropDownColumn
that can automatically render a RadCombobox during edits. If you choose to use the built-in column type, you need to programmatically set the client-side event handlers for the rendered RadGrid, like this:Where "onselectedindexchanged" is the name of a client-side JavaScript function on your page designed to handle the RadCombobox event.
Either of these approaches should enable you to achieve your goal.