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

Concatenate selected value with existing column content in grid

2 Answers 90 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 05 Nov 2011, 12:57 PM
Hi I have a combox in the edit template of a column in a grid . I would like to intercept the selected value and add it to the existing column content , rather than replace it when Update button is clicked. Can you give me some pointers? Which grid event ? How to grab the existing value , and rebind it with the selected value? ( I'll add a comma separator) Thanks for help with this. I am going round in circles but not getting to the solution . Thanks Clive

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Nov 2011, 04:17 AM
Hello Clive,

Check the following help documentation which explains more about this.
Operations with MS DropDownList in EditItemTemplate of GridTemplateColumn.

Thanks,
Shinu.
0
Dimitar Terziev
Telerik team
answered on 09 Nov 2011, 08:53 AM
Hi Clive,

In order to achieve the desired functionality you should manually updated your data source with the value selected from the RadComboBox. First you should subscribe on the SelectedIndexChanged event of the RadComboBox. In the event handler function you should get reference to the GridDataItem which is currently being edited. This could be done by accessing the NamingContainer of the RadComboBox. Once you have a reference to the GridDataItem you will find the corresponding record in the database and append the newly selected value to the existing one, so when the update command is executed the Grid will be bound to this new value.

Regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ComboBox
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dimitar Terziev
Telerik team
Share this question
or