Hi
I am using asp.net treeview control in my project. Here i am binding nodes to treeview at runtime. My requirement is based on the active status of record i want to change tree node forecolor. If recode is active then blue ,if recode is inactive then gray. Following is the code i wrote to bind tree node at runtime.
private void BindTreeViewMenu(DataTable dataSource)
{
if (dataSource != null)
{
if (dataSource.Rows.Count > 0)
{
tvMenu.Nodes.Clear();
foreach (DataRow masterRow in dataSource.Rows)
{
TreeNode masterNode = new TreeNode((string)masterRow["Title"]);
masterNode.Value = Convert.ToString(masterRow["SlideId"]);
tvMenu.Nodes.Add(masterNode);
}
}
}
}
Please let me know how to achieve my requirement.