reorderList使用

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />

<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="asm" runat="server">
    </ajaxToolkit:ToolkitScriptManager>

<div>

<asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>

<ajaxToolkit:ReorderList
   ID="rl1"
  runat="server"
  SortOrderField="position"
        AllowReorder="true"
         DataSourceID="sds"
         DataKeyField="id" onitemreorder="rl1_ItemReorder"   > 
             <DragHandleTemplate> 
                      <div class="DragHandleClass">   
                             </div>   
                               </DragHandleTemplate>   
                                 <ItemTemplate> 
     <asp:Label ID="ItemLabel" runat="server" Text=‘<%#Eval("description") %>‘ />  
     </ItemTemplate>

<ReorderTemplate>
                            <asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" />
                        </ReorderTemplate>

</ajaxToolkit:ReorderList>

<asp:SqlDataSource
       ID="sds"
       runat="server"
       ConnectionString="Data Source=.;Initial Catalog=MyRoleTest;Integrated Security=True" 
           ProviderName="System.Data.SqlClient"
           OldValuesParameterFormatString="original_{0}"   
             SelectCommand="SELECT [id], [char], [description], [position] FROM [AJAX] ORDER BY [position]"    
              UpdateCommand="UPDATE [AJAX] SET [email protected] WHERE [id][email protected]_id">   
                <UpdateParameters>      
                    <asp:Parameter Name="position" Type="Int32" />  
                            <asp:Parameter Name="original_id" Type="Int32" />    
                </UpdateParameters>
        </asp:SqlDataSource>

</ContentTemplate>
     </asp:UpdatePanel>

<%--
   <div class="demoarea">
        <div class="demoheading">ReorderList Demonstration</div>
        <i>To Do:</i>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div class="reorderListDemo">
                    <ajaxToolkit:ReorderList ID="ReorderList1" runat="server"
                        PostBackOnReorder="false"
                        DataSourceID="ObjectDataSource1"
                        CallbackCssStyle="callbackStyle"
                        DragHandleAlignment="Left"
                        ItemInsertLocation="Beginning"
                        DataKeyField="ItemID"
                        SortOrderField="Priority">
                        <ItemTemplate>
                            <div class="itemArea">
                                <asp:Label ID="Label1" runat="server"
                                    Text=‘<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Title"))) %>‘ />
                                <asp:Label ID="Label2" runat="server"
                                    Text=‘<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Description", " - {0}"))) %>‘ />
                            </div>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <div class="itemArea">
                                <asp:TextBox ID="TextBox2" runat="server" Text=‘<%# Bind("Title") %>‘ ValidationGroup="edit" />
                                <asp:TextBox ID="TextBox3" runat="server" Text=‘<%# Bind("Description") %>‘ ValidationGroup="edit" />
                                <asp:TextBox ID="TextBox4" runat="server" Text=‘<%# Bind("Priority") %>‘ ValidationGroup="edit" />
                            </div>
                        </EditItemTemplate>
                        <ReorderTemplate>
                            <asp:Panel ID="Panel2" runat="server" CssClass="reorderCue" />
                        </ReorderTemplate>
                        <DragHandleTemplate>
                            <div class="dragHandle"></div>
                        </DragHandleTemplate>
                        <InsertItemTemplate>
                            <!-- bottom border is workaround for IE7 Beta issue where bg doesn‘t render -->
                            <div style="padding-left:25px; border-bottom:thin solid transparent;">
                                <asp:Panel ID="panel1" runat="server" DefaultButton="Button1">
                                    <asp:TextBox ID="TextBox1" runat="server" Text=‘<%# Bind("Title") %>‘ ValidationGroup="add" />
                                    <asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Add"  ValidationGroup="add" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="add"
                                        ErrorMessage="Please enter some text" ControlToValidate="TextBox1" />
                                </asp:Panel>
                            </div>
                        </InsertItemTemplate>
                    </ajaxToolkit:ReorderList>
                </div>
   
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
                    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="Select"
                    TypeName="SessionTodoXmlDataObject" UpdateMethod="Update">
                    <DeleteParameters>
                        <asp:Parameter Name="Original_ItemID" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Title" Type="String" />
                        <asp:Parameter Name="Description" Type="String" />
                        <asp:Parameter Name="Priority" Type="Int32" />
                        <asp:Parameter Name="Original_ItemID" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Title" Type="String" />
                        <asp:Parameter Name="Description" Type="String" />
                        <asp:Parameter Name="Priority" Type="Int32" />
                    </InsertParameters>
                </asp:ObjectDataSource>   
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>

--%>

</div>
    </form>

时间: 2024-10-11 18:47:57

reorderList使用的相关文章

reorder-list——链表、快慢指针、逆转链表、链表合并

Given a singly linked list L: L0→L1→-→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→- You must do this in-place without altering the nodes' values. For example,Given{1,2,3,4}, reorder it to{1,4,2,3}. 由于链表尾端不干净,导致fast->next!=NULL&&fast->next-&

ReorderList 的使用

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">        </asp:ToolkitScriptManager>        <asp:UpdatePanel ID="UpdatePanel1" runat="server">        <ContentTemplate>     

[LeetCode]Reorder List

Given a singly linked list L: L0→L1→-→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→- You must do this in-place without altering the nodes' values. For example, Given {1,2,3,4}, reorder it to {1,4,2,3}. 这道题是将一个给定的单链表按照某种规则进行重排序,要求是不可以简单地直接交换结点中的值. 思路

leetcode笔记

leetcode 笔记 Linked List 2. Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a

143. Reorder List

本周对链表操作进行了巩固 题目: Given a singly linked list L: L0→L1→-→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→- You must do this in-place without altering the nodes' values. For example,Given {1,2,3,4}, reorder it to {1,4,2,3}. 题解: 这道题虽然看上去很复杂,但经过分析,可知实质上这道题就是

Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example,Given {1,2,3,4}, reorder it to {1,4,2,3}. 这是一道比较综合的链表题目.一开始拿到手足无措.慢慢分析了一下,其实做法无非分三步: 1.将链表分

leetcode143 Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example,Given {1,2,3,4}, reorder it to {1,4,2,3}. 1 /** 2 * Definition for singly-linked list. 3 *

leetcode-143. Reorder List

刚开始刷题,一开始没思路,上网看了一下别人的思路才写出来 总的思路就是先把链表分为两部分,可以先遍历链表再根据长度分也可以用快慢指针(新知识点),然后将第二部分反转,再依次插入到第一部分.思路很简单,但没用ide还是出错了... /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }

[Linked List]Reorder List

otal Accepted: 54991 Total Submissions: 252600 Difficulty: Medium Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example,Given {1,2,3,4}, reorder