I'm having a heck of a time getting a redorder list to reorder using sqlite. The table is simple, 1 prime key, 4 data fields, and an int order field.
Here's my code. The query is fine, but the reorder simply doesn't seem to work.
1 <td class="style1" valign="top">
2 <cc1:ReorderList ID="ReorderList1" runat="server" AllowReorder="True"
3 DataKeyField="ID" DataSourceID="data_v_playing_queue"
4 PostBackOnReorder="False" SortOrderField="SORT_ORDER"
5 CallbackCssStyle="callbackStyle"
6 DragHandleAlignment="Left">
7 <ItemTemplate>
8 <div class="itemArea">
9 <asp:Label ID="Label1" runat="server"
10 Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("TRACK"))) + " - "%>' />
11 <asp:Label ID="Label2" runat="server"
12 Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("TITLE"))) + " - "%>' />
13 <asp:Label ID="Label3" runat="server"
14 Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("ARTIST"))) %>' />
15 </div>
16 </ItemTemplate>
17 <ReorderTemplate>
18 <asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" />
19 </ReorderTemplate>
20 <DragHandleTemplate>
21 <div class="dragHandle"></div>
22 </DragHandleTemplate>
23
24 </cc1:ReorderList>
25 <asp:SqlDataSource ID="data_v_playing_queue" runat="server"
26 ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
27 ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
28 SelectCommand="SELECT * FROM [queue] order by sort_order"
29 UpdateCommand="UPDATE [queue] SET SORT_ORDER = @SORT_ORDER WHERE (ID = @ID)">
30 <UpdateParameters>
31 <asp:Parameter Name="@SORT_ORDER" DbType="Int32" Type="Int32"/>
32 <asp:Parameter Name="@ID" Type="Int32" DbType="Int32"/>
33 </UpdateParameters>
34 </asp:SqlDataSource>
35 </td>
I can run the update by hand from server explorer and it works fine. It just doesn't seem to save it when run from the control. Any ideas? If I take the update command out I get the typical alert about not being able to update. So with it in I'm assuming its calling it. Help please :)