Hi,
I was looking the TreeList demo and I find this demo (http://demos.telerik.com/aspnet-ajax/treelist/examples/firstlook/defaultcs.aspx). In this demo, they add a dataSource to their TreeList and they used a <ItemTemplate> to put the ProductName and the Quantity in the same field. Here the code:
<%# Eval("ProductName")%><%# Eval("Quantity").ToString() != "" ? " (" + Eval("Quantity").ToString() + ")" : ""%>
I wonder if it was possible to do the same, but in the code-behind (serverside).
Here is my code :
What I want is to take the fields (in my datasource) "firstName" and "lastName" and put it together in the "nameColumns" by using a itemTemplate.
Thank you
David
I was looking the TreeList demo and I find this demo (http://demos.telerik.com/aspnet-ajax/treelist/examples/firstlook/defaultcs.aspx). In this demo, they add a dataSource to their TreeList and they used a <ItemTemplate> to put the ProductName and the Quantity in the same field. Here the code:
<%# Eval("ProductName")%><%# Eval("Quantity").ToString() != "" ? " (" + Eval("Quantity").ToString() + ")" : ""%>
I wonder if it was possible to do the same, but in the code-behind (serverside).
Here is my code :
if (e.Node.Text == "Users")
{
Telerik.Web.UI.TreeListBoundColumn nameColumn =
new Telerik.Web.UI.TreeListBoundColumn();
nameColumn.DataField = "name";
nameColumn.UniqueName = "name";
nameColumn.HeaderText = "Name";
RadTreeList1.Columns.Clear();
RadTreeList1.Columns.Add(nameColumn);
RadTreeList1.DataSource = MyDataUser.GetData();
}
What I want is to take the fields (in my datasource) "firstName" and "lastName" and put it together in the "nameColumns" by using a itemTemplate.
Thank you
David