Get values from combobox in edit mode?

2 posts, 0 answers
  1. Paul
    Paul avatar
    27 posts
    Member since:
    Feb 2012

    Posted 18 Jul Link to this post

    Hi all...

     

    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...
    }

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 21 Jul Link to this post

    Hi Paul,

    Please examine the following article that describes how you can get the values from the column editors in RadGrid and update the database.


    Also, if you would like additional information on accessing controls in RadGrid cells you would find the article below interesting.



    Regards,
    Viktor Tachev
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top