I'm trying to play with the ReorderList control, but I'm not having any luck. We don't use front end ObjectDataSource controls.
Here's my code:
<atlas:UpdatePanel ID="aupReorderList" runat="server">
<ContentTemplate>
<div class="reorderListDemo">
<atlasToolkit:ReorderList ID="rlTasks" runat="server" OnItemDataBound="rlTasks_ItemDataBound">
<ItemTemplate>
<div>
<asp:Label ID="lblTaskName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</div>
</ItemTemplate>
<ReorderTemplate>
<asp:Panel ID="Panel2" runat="server" CssClass="reorderCue">
</asp:Panel>
</ReorderTemplate>
<DragHandleTemplate>
<div class="dragHandle">
</div>
</DragHandleTemplate>
<InsertItemTemplate>
<div style="padding-left: 25px">
<asp:TextBox ID="txtInsertTask" runat="server" Text=""></asp:TextBox>
<asp:LinkButton ID="lnkInsertTask" runat="server" OnClick="lnkAdd_InsertTask">Add</asp:LinkButton>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter some text" ControlToValidate="txtInsertTask"></asp:RequiredFieldValidator>
</div>
</InsertItemTemplate>
</atlasToolkit:ReorderList>
</div>
</ContentTemplate>
</atlas:UpdatePanel>
And here's my Code Behind:
private void BindList()
{
SqlConnection conTasks;
SqlCommand cmdTasks;
SqlDataAdapter dadTasks;
DataTable tblTasks = new DataTable();
conTasks = new SqlConnection("Server=ASIA-NEW\\SQL2005;Database=Tasks;User ID=rternier;Password=******");
cmdTasks = new SqlCommand("EXEC TaskList", conTasks);
cmdTasks.Connection.Open();
dadTasks = new SqlDataAdapter(cmdTasks);
dadTasks.Fill(tblTasks);
cmdTasks.Connection.Close();
rlTasks.DataSource = tblTasks;
rlTasks.DataBind();
}
When it renders, it renders the right amount of items, but doesn't put the text in. I've even used the ItemDataBound event and loaded the "name" field into the Label, and the name does go in there properly, but when rendered, it's empty.
I took off all CSS to it would display as text.
Any advice?
The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.
My Site |
My Examples |
My Blog 