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

How to edit value in a SelectedRow

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robb
Top achievements
Rank 1
Robb asked on 21 Mar 2012, 12:46 PM
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?

1 Answer, 1 is accepted

Sort by
0
Robb
Top achievements
Rank 1
answered on 21 Mar 2012, 02:26 PM
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();

Tags
GridView
Asked by
Robb
Top achievements
Rank 1
Answers by
Robb
Top achievements
Rank 1
Share this question
or