I have a gridView which is movable with dragAndDrop. But i am able only for move the row of gridView using dragAndDrop. This is my code:
gridView1.datasource = dt;
gridView1.dataBind();
<asp:GridView ID="GridView3" CellPadding="5" CellSpacing="0"
OnRowDataBound="GridView3_RowDataBound"
ForeColor="#333" runat="server"
AutoGenerateColumns="true">
</asp:GridView>
<asp:Button ID="Save" runat="server" Text="Save" onclick="btnsave_Click" />
// use of JQuery for dragAndDrop
$(function () {
$("[id*=GridView1]").sortable({
items: 'tr:not(tr:first-child)',
cursor: 'pointer',
axis: 'y',
dropOnEmpty: false,
start: function (e, ui) {
ui.item.addClass("selected");
},
stop: function (e, ui) {
ui.item.removeClass("selected");
},
receive: function (e, ui) {
$(this).find("tbody").append(ui.item);
}
});
});
Using this code, i am only able to move rows of gridView. But i want, when i will click on save button then the order of rows which are changed by dragAndDrop will be shown. thanks.