Hi I have implemented a list that i want to be able to order using drag and drop.
I have implemented the list using the ajaxToolkit ReorderList.
It works perfectly on the user interface the problem i am having is related to the update of the data into the database.
I created a button that allows the user to save the changes (all at once), the problem is that in the click event if I loop troughs the ReorderList the items are returned in the original order, not the one as the user have modified it. Seems like despite the list is re-orderd the ReorderList maintains the original datasource.
this is my list
<ajaxToolkit:ReorderList ID="rlVerticalMenu" runat="server" DragHandleAlignment="Left"
ItemInsertLocation="Beginning" DataKeyField="Id" SortOrderField="Priority"
EnableViewState="true" OnItemReorder="rlWorkItems_ItemReorder"
CallbackCssStyle="ClsCallBackStyle" CssClass="ClsReorderListContainer">
<ItemTemplate>
<div class="ClsItemArea">
<div>
<asp:Label ID="LblId" runat="server" Visible="false" CssClass="editable_textarea" Text='<%# Eval("Id").ToString() %>' />
<div class="verticalMenuItem">
<asp:Label ID="LblDisplayName" runat="server" CssClass="editable_textarea" Text='<%# Eval("DisplayName").ToString() %>' />
</div>
<div class="verticalMenuItem">
<asp:Label ID="LblHref" runat="server" CssClass="editable_textarea" Text='<%# Eval("Href").ToString() %>'/>
</div>
<div class="verticalMenuItem">
<asp:Label ID="LblTooltip" runat="server" CssClass="editable_textarea" Text='<%# Eval("Tooltip").ToString() %>'/>
</div>
</div>
</div>
</ItemTemplate>
<ReorderTemplate>
<asp:Panel ID="Panel2" runat="server" CssClass="ClsReorderCue">
</asp:Panel>
</ReorderTemplate>
<DragHandleTemplate>
<div class="ClsDragHandle">
</div>
</DragHandleTemplate>
</ajaxToolkit:ReorderList>
<asp:Button ID="BtnGenerateMenu" runat="server" Text="Generate Menu" OnClick="BtnGenerateMenu_Click" />
</asp:Content>
Any idea how I should implement this? How do I implement the
protected void rlWorkItems_ItemReorder(object sender, ReorderListItemReorderEventArgs e)
{
}
method?
Thanks