how to move a row in datagrid up or down?

  • Thread starter Thread starter wu jianhua
  • Start date Start date
wu,

You can't really do this. You don't move rows in the data grid. What
you have to do is order the items in the source of data so that they are
ordered appropriately.

For data tables, this is the sort order on the DefaultView property, or,
if it is a DataView class itself, it is the sort property on that.

Hope this helps.
 
If you did want to do this then you would need to remove the row from the
underlying collection (Datatable, dataview, ilist) and insert it in the new
location.

It isn't a good idea for datasets that you are going to use to update you
database again as I think it might try and delete the row and then re-add it
to your database table.

For bound object collections it probably isnt a crime though

Ciaran
 
Back
Top