Hai,
I have a webdatatreee like the below image.
Here, I populate the datatree from datasets. In the datasets, i have one column like 'IS ACTIVE'. It may be 0 or 1.
I want to populate the webdatatree with some color in nodes. Suppose the node has IS ACTIVE field 0 means it will show in red color, and 1 means it will show blue color.
How can i do this?
Thanks in advance.
Hello Thangachan,
Thank you for contacting Infragistics!
I have done some looking into this matter and have found you can achieve this by handling the NodeBound event of the WebDataTree. In that you can check the value and assign a CssClass to the node based on that value:
protected void WebDataTree1_NodeBound(object sender, DataTreeNodeEventArgs e) { int value = (int)((System.Data.DataRowView)(((Infragistics.Web.UI.Framework.Data.DataSetNode)(e.Node.DataItem)).Item)).Row.ItemArray[0]; if (value == 0) { e.Node.CssClass = "styleNam1"; } else if (value == 1) { e.Node.CssClass = "styleNam2"; } }
Please let me know if you have any further questions concerning this matter.
In that dataset which i am using to populate the webdatatree, That have more datatables.
then how can i mention the following line:
int value = (int)((System.Data.DataRowView)(((Infragistics.Web.UI.Framework.Data.DataSetNode)(e.Node.DataItem)).Item)).Row.ItemArray[0];
Please help me.