We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Finding GroupBarItem from Client Control

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;

3 Replies

GP Gurucharan Patwal Syncfusion Team December 8, 2003 09:01 PM UTC

Hi Chuck, 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. Regards, Guru Patwal Syncfusion, Inc.

AD Administrator Syncfusion Team December 9, 2003 12:01 PM UTC

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.

AD Administrator Syncfusion Team December 9, 2003 06:38 PM UTC

Hi Chuck, 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. Regards, Guru Patwal. Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon