我需要以编程方式更改树视图中节点的颜色。asp.net 或 jquery 有什么解决方案吗?PS:我正在按需绑定树视图节点。
private void BindTreeViewControl()
{
try
{
DataTable dt = new DataTable();
dt = GetData();
for (int i = 0; i < dt.Rows.Count; i++)
{
TreeNode root = new TreeNode(dt.Rows[i]["Name"].ToString(), dt.Rows[i]["Name"].ToString());
root.SelectAction = TreeNodeSelectAction.SelectExpand;
root.ShowCheckBox = true;
child.PopulateOnDemand = Convert.ToUInt32(dt.Rows[i]["Count"]) > 0; TreeViewDemo.Nodes.Add(root);
}
}
catch (Exception Ex)
{
throw Ex;
}
}