I have a treeview wich is populated from SqlDataSource.
Every thing populates just fine, except that i cant select any of my childnodes,
How do I setup a url to newNode so when i click on my product it will display
them in my contentplace holder???
this is my code sofare:
protected void GetProductsForCategory(TreeNode node)
{
String categoryId = node.Value;
ProductList products = WarehouseDB.GetProductsForCategory(categoryId);
foreach (Product p in products)
{
TreeNode newNode = new TreeNode(p.Name, p.Id);
newNode.PopulateOnDemand = false;
node.ChildNodes.Add(newNode);
newNode.SelectAction = TreeNodeSelectAction.Select;
newNode.NavigateUrl="../Catalog.aspx?DepartmentID=' + Request.QueryString['DepartmentID'] + '&CategoryID=' + Eval('CategoryID')";
}
}
protected void PopulateNode(Object source, TreeNodeEventArgs e)
{
switch (e.Node.Depth)
{
case 0:
GetDepartment(e.Node);
break;
case 1:
GetProductCategories(e.Node);
break;
case 2:
GetProductsForCategory(e.Node);
break;
}
}
Please note that my NavigationUrl works in my former usercontrol CatgeoriesList
i would like to translate it to work in my treeview