I have a TreeView control as a GroupBarItems client. How would you get from the treeview control to the groupbaritem? I basically want to make the whole groupbaritem invisible if the treeview is empty. I was trying the following which points to the groupbar not the specific item:
if (tv.nodes.count == 0)
tv.parent.visible = false;
GPGurucharan Patwal Syncfusion Team December 8, 2003 04:01 PM
The GroupBarItem is an object of type Syncfusion.Windows.Forms.Tools.GroupBarItem and TreeViewAdv.Parent is of type Control. So it is not possible to assign the GroupBarItem as the Parent of the TreeViewAdv. In most cases the main form itself is the TreeViewAdv''s Parent. Hence the above code will not work as expected. It will set the entire the main form itself invisible. One possible way to get around this problem would be to explicitly set the appropriate GroupBarItem.Visible property to false. Please refer to the sample application attached here : Sample_Application
and let me know if this meets your requirements. Thanks for your cooperation.
ADAdministrator Syncfusion Team December 9, 2003 07:01 AM
Well that didn''t really answer the question at all. The problem is that I need to get from the treeview (not treeviewadv) to the groupbaritem that it lives under. I ended up doing this by setting the tag of each groupbaritem equal to its associated treeview. Then searching to find it by iterating through the groupbar controls groupbaritems. I would have gone the other way (set the treeviews tag) but I was already using the tag for something else.
ADAdministrator Syncfusion Team December 9, 2003 01:38 PM
Thanks for the update. Apologies for not having understood your requirements correctly earlier. I have modified my previous sample accordingly (Sample_Application_Modified), and the workaround suggested by you seems to work fine. Thanks for sharing this information with us. Please let me know if you need any other information.