Hi,
Is there a way to add a new row in a band at a particular position?
For example if I need to add the new row, above or below the selected row.
Regards,
Ceaser
Ceaser,
This depends on your data source, in that you might be able to insert the row directly into the proper location in the underlying data source. If you do this, you can get the index of the selected row by checking its ListIndex and then insert a row directly before that row in the data source. If you are using a DataTable, however, there are issues where it will report the incorrect location of the new row to the grid. If this is the case, you can move the row using the Move method on the Rows collection, specifying that you can move it to the new grid index before the selected row's Index, i.e.
grid.Rows.Move(newRow, selectedRow.Index );
-Matt