Note that there are some explanatory texts on larger screens.

plurals
  1. PODrag and Drop in .Net c#
    primarykey
    data
    text
    <p>I have implemented a list that i want to be able to order using drag and drop.</p> <p>I have implemented the list using the ajaxToolkit ReorderList. </p> <p>It works perfectly on the user interface the problem i am having is related to the update of the data into the database.</p> <p>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. </p> <p>this is my list</p> <pre><code>&lt;ajaxToolkit:ReorderList ID="rlVerticalMenu" runat="server" DragHandleAlignment="Left" ItemInsertLocation="Beginning" DataKeyField="Id" SortOrderField="Priority" EnableViewState="true" OnItemReorder="rlWorkItems_ItemReorder" CallbackCssStyle="ClsCallBackStyle" CssClass="ClsReorderListContainer"&gt; &lt;ItemTemplate&gt; &lt;div class="ClsItemArea"&gt; &lt;div&gt; &lt;asp:Label ID="LblId" runat="server" Visible="false" CssClass="editable_textarea" Text='&lt;%# Eval("Id").ToString() %&gt;' /&gt; &lt;div class="verticalMenuItem"&gt; &lt;asp:Label ID="LblDisplayName" runat="server" CssClass="editable_textarea" Text='&lt;%# Eval("DisplayName").ToString() %&gt;' /&gt; &lt;/div&gt; &lt;div class="verticalMenuItem"&gt; &lt;asp:Label ID="LblHref" runat="server" CssClass="editable_textarea" Text='&lt;%# Eval("Href").ToString() %&gt;'/&gt; &lt;/div&gt; &lt;div class="verticalMenuItem"&gt; &lt;asp:Label ID="LblTooltip" runat="server" CssClass="editable_textarea" Text='&lt;%# Eval("Tooltip").ToString() %&gt;'/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;ReorderTemplate&gt; &lt;asp:Panel ID="Panel2" runat="server" CssClass="ClsReorderCue"&gt; &lt;/asp:Panel&gt; &lt;/ReorderTemplate&gt; &lt;DragHandleTemplate&gt; &lt;div class="ClsDragHandle"&gt; &lt;/div&gt; &lt;/DragHandleTemplate&gt; &lt;/ajaxToolkit:ReorderList&gt; &lt;asp:Button ID="BtnGenerateMenu" runat="server" Text="Generate Menu" OnClick="BtnGenerateMenu_Click" /&gt; &lt;/asp:Content&gt; </code></pre> <p>Any idea how I should implement this? How do I implement the </p> <pre><code>protected void rlWorkItems_ItemReorder(object sender, ReorderListItemReorderEventArgs e) { } </code></pre> <p>method?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload