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

[Solved] ComboBox and automatic db update

3 Answers 164 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ang
Top achievements
Rank 1
ang asked on 17 Jan 2008, 04:28 PM
Hi, I don't understand if is possible to set comboBox at design time to automatically update a field in a db table, chosing values from an other table, or from a manually edited items list. Or if not how programmatically get the se;ected value (server side)
There is any example that do this?

Thanks very much, Angdrak

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 18 Jan 2008, 08:44 AM
Hi ang,

RadComboBox cannot take care of updating the database. You should update the database yourself and rebind the combobox by calling the DataBind method of the control.

To get the selected value you should simply use the SelectedValue property of the combobox object with no regard to whether the items have been added via callback or not.

Hope this helps.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
ang
Top achievements
Rank 1
answered on 18 Jan 2008, 10:26 AM
Ok, but if the ComboBox is defined as template of a gridTemplateColumn, when and how get the selectedValue.
In inserting event of the sqlDatasource if I directly refer to the ComboBoxID, I get a compile error that says that is undefined.

Thanks, Angdrak
0
Rosi
Telerik team
answered on 21 Jan 2008, 09:58 AM
Hi Ang,

Please see our online example. It demonstrates the needed approach how to set the SelectedValue.
Also you cannot directly refer to the combobox by using its id if RadCombobox is in a template of another control. How you can do this can be read here.

If this does not helps you, please open a support ticket and send us a simple and running project illustrating the problem.

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
ang
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
ang
Top achievements
Rank 1
Rosi
Telerik team
Share this question
or