Hello:
How can I create a delete button to remove a selected record? using <ajaxToolKit:ReorderList> and <DragHandleTemplate>? I saw a few samples but non of them have the delete capability. Is it possible at all? I am trying to modify the code below to be able to delete a selected record. Thanks.
---------MY CODE------------
<ajaxToolKit:ReorderList ID="ReorderList1" runat="server" PostBackOnReorder="false" DataSourceID="SqlDataSource1" CallbackCssStyle="callbackStyle" DragHandleAlignment="Left" ItemInsertLocation="Beginning" DataKeyField="id" SortOrderField="orderNumber">
<ReorderTemplate>
<aspanel ID="Panel2" runat="server" Width="800px" CssClass="reorderCue" />
</ReorderTemplate>
<DragHandleTemplate>
<div style="cursor: move; background-color:#E2E3C2" class="dragHandle">
<table>
<tr>
<td valign="top">
<asp:Label ID="Label1" runat="server" Width="80px" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("courseId"))) %>' />
</td>
<td valign="top">
<asp:Label ID="Label2" runat="server" Width="400px" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("courseTitle"))) %>' />
</td>
</tr>
</table>
</div>
</DragHandleTemplate>
</ajaxToolKit:ReorderList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$connectionStrings:dbConnectionString %>"
SelectCommand="SELECT [id], [studentId], [courseId], [courseTitle] FROM [tblQueue] WHERE studentId= @studentId Order By [orderNumber]"
UpdateCommand="UPDATE [tblQueue] SET [studentId] = @studentId, [courseId] = @courseId, [courseTitle] = @courseTitle, [orderNumber] = @orderNumber WHERE [id] = @id"
DeleteCommand="DELETE FROM [tblQueue] WHERE [id] = @id, [studentId] = @studentId, [courseId] = @courseId, [courseTitle] = @courseTitle, [orderNumber] = @orderNumber">
<SelectParameters>
<asp:SessionParameter SessionField="studentId" Name="studentId" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="CourseId" Type="String" />
<asparameter Name="courseTitle" Type="String" />
<asparameter Name="orderNumber" Type="Int32" />
<asparameter Name="id" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="CourseId" Type="String" />
<asparameter Name="courseTitle" Type="String" />
<asparameter Name="orderNumber" Type="Int32" />
<asparameter Name="id" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
How can I create a delete button to remove a selected record? using <ajaxToolKit:ReorderList> and <DragHandleTemplate>? I saw a few samples but non of them have the delete capability. Is it possible at all? I am trying to modify the code below to be able to delete a selected record. Thanks.
---------MY CODE------------
<ajaxToolKit:ReorderList ID="ReorderList1" runat="server" PostBackOnReorder="false" DataSourceID="SqlDataSource1" CallbackCssStyle="callbackStyle" DragHandleAlignment="Left" ItemInsertLocation="Beginning" DataKeyField="id" SortOrderField="orderNumber">
<ReorderTemplate>
<aspanel ID="Panel2" runat="server" Width="800px" CssClass="reorderCue" />
</ReorderTemplate>
<DragHandleTemplate>
<div style="cursor: move; background-color:#E2E3C2" class="dragHandle">
<table>
<tr>
<td valign="top">
<asp:Label ID="Label1" runat="server" Width="80px" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("courseId"))) %>' />
</td>
<td valign="top">
<asp:Label ID="Label2" runat="server" Width="400px" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("courseTitle"))) %>' />
</td>
</tr>
</table>
</div>
</DragHandleTemplate>
</ajaxToolKit:ReorderList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$connectionStrings:dbConnectionString %>"
SelectCommand="SELECT [id], [studentId], [courseId], [courseTitle] FROM [tblQueue] WHERE studentId= @studentId Order By [orderNumber]"
UpdateCommand="UPDATE [tblQueue] SET [studentId] = @studentId, [courseId] = @courseId, [courseTitle] = @courseTitle, [orderNumber] = @orderNumber WHERE [id] = @id"
DeleteCommand="DELETE FROM [tblQueue] WHERE [id] = @id, [studentId] = @studentId, [courseId] = @courseId, [courseTitle] = @courseTitle, [orderNumber] = @orderNumber">
<SelectParameters>
<asp:SessionParameter SessionField="studentId" Name="studentId" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="CourseId" Type="String" />
<asparameter Name="courseTitle" Type="String" />
<asparameter Name="orderNumber" Type="Int32" />
<asparameter Name="id" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="CourseId" Type="String" />
<asparameter Name="courseTitle" Type="String" />
<asparameter Name="orderNumber" Type="Int32" />
<asparameter Name="id" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>