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

Get selected item from Combobox in Grid: Edit mode

1 Answer 193 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Iron
Paul asked on 18 Jul 2016, 07:46 PM
I apologize for cross posting but couldn't decide what made the most sense :(

I need to run a couple of discrete stored proc when I do my update from a grid.  I need to check if the combobox selection indicates a change to one field and if so execute etc.
I can't for the life of me figure out how to get that value, I tried an selectedindexchanged event and that doesn't seem to work either. I'd be very grateful for a nudge in the right direction as I'm veryyyyyyyyyy rusty :(

Here's what I tried most recently:

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
{

if (e.CommandName == "Update")
{


GridEditableItem item = (GridEditableItem)e.Item;
RadComboBox combo =(RadComboBox)item.FindControl("updateComboBox");
var status = (string)item.GetDataKeyValue("status");
if (combo.SelectedItem.Text!= status)
{
 // Do my update...
}

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 21 Jul 2016, 01:21 PM
Hello Paul,

There is already an answer in your other thread on this topic. I would like to suggest you also take a look at the similar FindControl inside RadGrid FormTemplateEditForm forum thread.  

Regards,
Peter Milchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Paul
Top achievements
Rank 1
Iron
Answers by
Peter Milchev
Telerik team
Share this question
or