Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, what you could do is persist your temporary list datasource in viewstate. Here's a rough example:</p> <pre><code>&lt;asp:ScriptManager ID="SM1" runat="server"&gt;&lt;/asp:ScriptManager&gt; &lt;ajaxToolkit:ReorderList ID="RList" runat="server" DragHandleAlignment="Left" ItemInsertLocation="End" AllowReorder="true" ShowInsertItem="true" PostBackOnReorder="false"&gt; &lt;ItemTemplate&gt; &lt;p&gt;&lt;%# Eval("ID") %&gt; = &lt;%# Eval("Name") %&gt;&lt;/p&gt; &lt;/ItemTemplate&gt; &lt;/ajaxToolkit:ReorderList&gt; &lt;asp:Button ID="ButtonAdd" runat="server" OnClick="ButtonClick_AddItem" Text="Add New" /&gt; </code></pre> <p>Then in codebehind:</p> <pre><code>public partial class SortList : System.Web.UI.Page { [Serializable] public class MyItem { public Guid Id { get; set; } public string Name { get; set; } public MyItem(Guid id, string name) { Id = id; Name = name; } } protected List&lt;MyItem&gt; MyList { get { if (ViewState["myClass"] == null) ViewState["myClass"] = new List&lt;MyItem&gt;(); return (List&lt;MyItem&gt;)ViewState["myClass"]; } } protected void AddItem(Guid id, string name) { MyList.Add(new MyItem(id, name)); RList.DataSource = MyList; RList.DataBind(); } protected void ButtonClick_AddItem(object sender, EventArgs e) { AddItem(Guid.NewGuid(), DateTime.Now.Ticks.ToString()); } } </code></pre> <p>Obviously you would substitute MyItem class with whatever you want to store and replace the button with the GridView select item event. But hopefully the principle is there?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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