Hi to all.
I would like to switch two rows in a datagridview without clearing the datagrid.
It is easy to make such a code:
but I don't want the
line of code.
The most beautiful thing should be drag and drop an entire row to another position but I don't know how and I haven't any idea too.
For me, it is enough to add 2 buttons in the row to put up or down the row for only one row.
But I don't know how to switch two rows and if it is possible.
Thanks' for all
Davide
I would like to switch two rows in a datagridview without clearing the datagrid.
It is easy to make such a code:
Code:
dgv.Clear();
for (int x = 0; x < n; x++)
{
dgv.Rows.Add(...); // in another order
}
Code:
dgv.Clear()
The most beautiful thing should be drag and drop an entire row to another position but I don't know how and I haven't any idea too.
For me, it is enough to add 2 buttons in the row to put up or down the row for only one row.
But I don't know how to switch two rows and if it is possible.
Thanks' for all
Davide