Change the value of cell
Hi There,
I'd like to know how to change the value of cell
just like
grid.Rows[iRowIndex].Columns[iColumnIndex].Value = "1234";
iRowIndex should be found from searching. eg. if( grid.rows.column[0] is "a").
Thanks in advance.
0
-
Hi,
You have many possibilities:
1.Cell cell = grid.Rows[iRowIndex][iColumnIndex];
cell.Value = newValue;2. If you use objects is an instance of a custom class, you can use:
Row row = grid.Rows[iRowIndex];
YourClass yourObject = (YourClass)row.DataObject;
//Do something with the object
...If the YourClass implements INotifyPropertyChanged, the grid will get notifications automatically. (In case of sorting, filtering, grouping it updates the content and row's position if needed). Otherwise, you can call row.Update() to update these operations.
Regards,
Dapfor0
Please sign in to leave a comment.
Comments
1 comment