This example demonstrates how to use buttons and jQuery drag-and-drop functionality to reorder rows in ASPxGridView.
Set up the grid and create an invisible column that stores row order indices. Sort the grid by this column and disable sorting at the control level.
<dx:ASPxGridView ID="gvProducts" runat="server" ...>
<Columns>
...
<dx:GridViewDataTextColumn FieldName="DisplayOrder" Visible="false" SortIndex="0"
SortOrder="Ascending" />
</Columns>
<SettingsBehavior AllowSort="false" ... />
...
</dx:ASPxGridView>
When a user clicks the button or drags and drops a row, the grid sends a callback to the server, sets the invisible column value to a new row order index, and updates the grid data.
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)