Hi, Clay
I used the method in your attachment to move rows up and down. It worked fine in the grid. But it was not updated in the DataSet or DataTable object because the data still had the same sequence after I saved and reloaded. I checked my code that I have called the AcceptChanges() method in the either the DataTable or the DataSet object.
Could you show me another way of moving rows as you mentioned in your previous message?
Sam
> In a GridDataBoundGrid, the grid just displays the rows as they are presented to it by the underlying datasource. So, if you want to move the position of the rows in the grid, currently you have to do so by moving them in the underlying datasource.
>
>
Here is one way you can do it. This sample adds an additional column to the datatable that holds a sortKey that reflects where you want the row to be. You don't display this column (you can hide using GridBoundColumn for the columns you want to see, or you can just hide it in the grid as the sample does). When you initially set the DataSource to the grid, you sort the datatable on this column using its defaultview.sort property. Then when you want to move rows, all you have to do is to move the sortKey values and the rows will rearrange themselves (as they must maintain the sort order).
>
>