Want to have the checkbox be checked (or not) depending on bound data. Am unable to get it to do so. Very simple test code. (sorry for state of what follows; have tried to edit it repeatedly to 'nice it up'.. editor s**ks!)
.axpx<ig:WebDataTree ID="WebDataTree1" runat="server" CheckBoxMode="biState"><DataBindings> <ig:DataTreeNodeBinding DataMember="tb1" KeyField="Id" TextField="Name" ValueField="CheckValue" /></DataBindings></ig:WebDataTree>
Hi contibeef,
Please feel free to contact me if you need further assistance regarding this matter.
Thank you for posting in the community.
You will need to set the checkbox state of each item in your WebDataTree after the data has been bound. This can be done in the DataBound event handler using the following code (developed using the dataset you have provided):
protected void WebDataTree1_DataBound(object sender, EventArgs e) { foreach (DataTreeNode node in WebDataTree1.AllNodes) { var isItemChecked = Int16.Parse((((System.Data.DataRowView)(((Infragistics.Web.UI.Framework.Data.DataSetNode)(node.DataItem)).Item)).Row.ItemArray[2]).ToString()); node.CheckState = (CheckBoxState) isItemChecked; } }
Please let me know if this helps.