I have a webdataTree with CheckboxMode = 'BiState'. Can you please let me know how I can hide a checkbox for a specific node on the server side.
DataTreeNode tn = new DataTreeNode(); tn.Text = dr["ID"].ToString() + " :: " + dr["LCD_NAME"].ToString(); tn.Value = dr["ID"].ToString(); tn.Key = dr["ID"].ToString(); tree.Nodes.Add(tn);
Please advice.
Hello Naveen,
Thank you for using our community.
Currently WebDataTree's CheckBoxMode applies to all nodes and levels. What I can suggest you to do is try using different templates for the nodes. http://help.infragistics.com/Doc/ASPNET/Current/CLR4.0?page=WebDataTree_Node_Templating.html
http://es.infragistics.com/community/forums/t/60787.aspx
What is more I would recommend you to log this issue as a feature idea at http://ideas.infragistics.com, the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top.
When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
Let me know if I may be of further assistance.
Hi Maria,
The example that gave me above is showing how to add static data nodes with templates and it does not help me. But what I'm doing is getting the data into a DataTable and loop through each row in a datatable and build the webdatatree manually. Please check my code below. For the last node which does not have any children, I don't want to show checkbox and just show image. I'm able to attach in image to the last child node, I'm not able to get rid of checkbox.
<ig:WebDataTree ID="wdtTree" runat="server" Height="650px" CheckBoxMode="Off" StyleSetName="Claymation" Font-Size="12px"> <DragDropSettings AllowDrop="true" EnableDragDrop="true" DragDropMode="Move" /> <NodeEditing Enabled="true" EnableOnDoubleClick="true" EnableOnF2="true" />
</ig:WebDataTree>
CodeBehind :
DataTreeNode tn = new DataTreeNode();tn.Text = dr["ID"].ToString() + " :: " + dr["NAME"].ToString();tn.Value = dr["ID"].ToString();tn.Key = dr["ID"].ToString();tree.Nodes.Add(tn);
I would really appreciate if you can provide me an example of adding a checkbox template to the node in code behind .
Thanks in advance.
I have missed to attache the sample.
I have modified previous reply and attached the sample.
Hello,
Thank you for your reply. Glad you were able to resolve the issue. Please do not hesitate to contact me if you have any further questions regarding this matter.
I don't see any example in your reply.
I'm using an alternative approach instead.. When a node is expanded I'm looping through all the nodes in the tree and checking the key of each node and based on the key text, I'm deleting the checkbox using the below example...
function HideCheckbox(node) { var childCount = node.get_childrenCount(); if (node.hasChildren()) { for (var i = 0; i < childCount; i++) { childNode = node.get_childNode(i); childNode._get_checkBox().get_element().style.display = "none"; } } }
You can set CssClass for the node for instance "no-checkbox-node" and then on Initialize client event you can get the all of the image siblings to the element of that class, basically that are the checkbox images and hide them.
For more refer to the attached sample.
Note that changing the HTML of item on the server is not supported by design, and the only way to hide the checkbox is on the client.