Ajax toolkit control Reorderlist doesn't reorder properly
<p>In asp.net ajax toolkit control I'm using reorderlist.</p>

<p>When I reorder for the first time it works fine, but further it doesn't.</p>

<p>Below is my code..</p>

<pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
&lt;/asp:ScriptManager&gt;
    &lt;asp:ReorderList ID="rlItemList" DragHandleAlignment="Left" PostBackOnReorder="false"
        DataKeyField="VentureCategoryID" runat="server" SortOrderField="DisplayOrder"
        OnItemReorder="rlItemList_ItemReorder" AllowReorder="true" ClientIDMode="AutoID"&gt;
        &lt;DragHandleTemplate&gt;
            &lt;div class="dragHandle"&gt;
            &lt;/div&gt;
        &lt;/DragHandleTemplate&gt;
        &lt;ItemTemplate&gt;
            &lt;asp:Label ID="lblVentureCategoryID" runat="server" Visible="false" Text='&lt;%#Eval("VentureCategoryID") %&gt;' /&gt;
            &lt;asp:Label ID="lblCategoryName" runat="server" Text='&lt;%#Eval("CategoryName") %&gt;' /&gt;
            &lt;asp:Label ID="lblIsActive" runat="server" Text='&lt;%#Eval("IsActive") %&gt;' /&gt;
            &lt;asp:Label ID="lblDisplayOrder" runat="server" Visible="false" Text='&lt;%#Eval("DisplayOrder") %&gt;' /&gt;
        &lt;/ItemTemplate&gt;
        &lt;ReorderTemplate&gt;
            &lt;asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" /&gt;
        &lt;/ReorderTemplate&gt;
    &lt;/asp:ReorderList&gt;
</code></pre>

<p>and the code behind is..</p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List&lt;VentureCategory&gt; VenList = VentureCategory.GetAll();
            rlItemList.DataSource = VenList;
            rlItemList.DataBind();

        }
    }

    protected void rlItemList_ItemReorder(object sender, ReorderListItemReorderEventArgs e)
    {
        var nId = e.NewIndex + 1;
        var oId = e.OldIndex + 1;
        List&lt;VentureCategory&gt; VenCatList = VentureCategory.GetAll();
        //foreach (var item in VenCatList)
        //{
        //    item.DisplayOrder = 9;
        //    VentureCategory.Update(item);
        //}
        int OldCategoryid = Convert.ToInt32(rlItemList.DataKeys[e.OldIndex].ToString());
        int NewCategoryid = Convert.ToInt32(rlItemList.DataKeys[e.NewIndex].ToString());

        var sortedList = VenCatList.OrderBy(sl =&gt; sl.DisplayOrder);
        var Count = 1;
        Label CatId = e.Item.FindControl("lblVentureCategoryID") as Label;
        var newcatId = Convert.ToInt32(CatId.Text);
        foreach (var item in sortedList)
        {
            if (oId &gt; nId &amp;&amp; Count &gt;= nId &amp;&amp; oId &gt;= Count)
                item.DisplayOrder = Count + 1;
            else if (nId &gt; oId &amp;&amp; nId &gt;= Count &amp;&amp; Count &gt;= oId)
                item.DisplayOrder = Count - 1;

            if (item.VentureCategoryID == newcatId)
                item.DisplayOrder = nId;
            VentureCategory.Update(item);
            Count++;
        }
    }
</code></pre>

<p>could anyone help me
Thanks in advance</p>
