Hi,
Based on certain criteria Im binding items in RadMenu, in which am supposed to populate the RadTreeView inside one of the RadMenuItem (named "Tools") dynamically. Ive done this using ItemDataBound of RadMenu. (below is the Code) :
from the above code, I am able to set the attributes for RadMenuItem
I need to set the same attribute on clicking on TreeViewNode. Please tell me how to do this?
Thanks in advance
KSP
Based on certain criteria Im binding items in RadMenu, in which am supposed to populate the RadTreeView inside one of the RadMenuItem (named "Tools") dynamically. Ive done this using ItemDataBound of RadMenu. (below is the Code) :
protected void TopMenu_ItemDataBound(object sender, RadMenuEventArgs e)
{
if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
e.Item.Attributes["onclick"] = "return Redirect(this.href);";
if (e.Item.Text.ToLower() == "Tools".ToLower())
{
RadMenuItem radTools = new RadMenuItem();
RadTreeView radToolTreeView = new RadTreeView();
radToolTreeView.DataTextField = "Text";
radToolTreeView.DataFieldID = "MenuID";
radToolTreeView.DataFieldParentID = "ParentID";
radToolTreeView.DataNavigateUrlField = "Url";
radToolTreeView.LoadingMessage = "Loading...";
radToolTreeView.Skin = "Web20";
radToolTreeView.CssClass = "MenuTreeView";
radToolTreeView.DataSource = BindToolMenu1();
radToolTreeView.BackColor = System.Drawing.Color.Aqua;
radToolTreeView.DataBind();
radToolTreeView.ExpandAllNodes();
radTools.Controls.Add(radToolTreeView);
e.Item.Items.Add(radTools);
}
}
from the above code, I am able to set the attributes for RadMenuItem
e.Item.Attributes["onclick"] = "return Redirect(this.href);";
I need to set the same attribute on clicking on TreeViewNode. Please tell me how to do this?
Thanks in advance
KSP