How to edit value in a SelectedRow

2 posts, 0 answers
  1. Robb
    Robb avatar
    4 posts
    Member since:
    Mar 2012

    Posted 21 Mar 2012 Link to this post

    Hi-hi,

    After row reorder (sorting in RadGridView), from my code I'm trying to set a value in selected rows.

    for(int i=0;i<myGrid.SelectedRows.Count;i++)
    myGrid.SelectedRows[i].Cells[0].Value = ":)";

    before row reorder (rows sorting from RadGridView control, by pressing on appropriate column) it works.
    after reorder - the only first row is available to edit, others are skipped.

    Why?
  2. Robb
    Robb avatar
    4 posts
    Member since:
    Mar 2012

    Posted 21 Mar 2012 Link to this post

    Fixed with

                if (ManGrid.Rows.Count == 0) return;


                var selectedRows = ManGrid.SelectedRows.ToArray();


                ManGrid.TableElement.BeginUpdate(); 


                foreach (var row in selectedRows)
                {
                    ((GridViewRowInfo)row).Cells[9].Value = d_serial.Text;
                }


                ManGrid.TableElement.EndUpdate();

Back to Top