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

[Solved] Add/ Edit option on Grid using ComboBox

3 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Howard
Top achievements
Rank 1
Howard asked on 06 Feb 2012, 02:28 AM
Hi support,

I have added a comboBox in the Grid for edit and add option. Now how can i save the data.
Do have some example of ComboBox in Grid ?

Thank you!

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 07 Feb 2012, 04:25 PM
Hello Niroj,

There are several examples on how to edit a property with a DropDownList:

The principal is the same when using a ComboBox. You should name the ComboBox the same as the model's property in order for the selected value to be applied and use the OnEdit or OnSave events to apply custom logic when necessary.

All the best,
Daniel
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Howard
Top achievements
Rank 1
answered on 07 Feb 2012, 11:33 PM
Hi Daniel,

I have tried with dropdownlist it works fine. But my concern is regarding the new text that we type in the comboBox that is not in dropdownlist and to save that.

But comboBox allows us to type new data which is not in the dropdownlist, and how can i check the new data is not in the list and how to update and insert that new data in database so that it appears next time in list ?

Thanks & Regards
0
Daniel
Telerik team
answered on 10 Feb 2012, 05:07 PM
Hello Niroj,

You could check whether the new value was in the list by handling the OnSave event and use the ComboBox data property to get the list. If the value is new you could make an Ajax request to save it. However, the value won't be added to the ComboBox until the Grid is reloaded on the server.

Greetings,
Daniel
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Grid
Asked by
Howard
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Howard
Top achievements
Rank 1
Share this question
or