Determine if BarItem is shown and its Bar
Is there a way to determine if a BarItem on a Bar has been turned off (hidden?) via the Quick Customize menu? When I check the BarItem''s Visible property it is always true even when I turn the item off with the Quick Customize menu.
SIGN IN To post a reply.
5 Replies
J.
J.Nagarajan
Syncfusion Team
May 10, 2006 05:07 PM UTC
Hi Don,
I have tested this issue and it seems to be a bug in menus. I have logged a bug report # 2058 in this regard. You can track the progress of this issue at this link below :
Defect #2058 - Visible property of BarItem always returns true after unchecking the BarItem with Quick Customize menu.
Thanks for bringing this issue to our attention. We will fix this issue at the earliest and keep you informed.
Thank you,
J.Nagaraj
AD
Administrator
Syncfusion Team
May 10, 2006 06:42 PM UTC
Thanks.
I figured the .Visible property may always be true because the manager doesn''t really use it. A BarItem can be on multiple bars (in this case, a menu and a tool bar), just because it is turned off on the toolbar via QuickCustomize doesn''t turn it off in the menu. I thought maybe this information was tracked by the bar itself but I can''t figure out how.
Thanks again.
MJ
Mano J
Syncfusion Team
May 11, 2006 03:41 PM UTC
Hi Don,
Thanks for the information. You can get the BarItem which is hidden using the Quick Customize Menu by deriving a customBarManager from MainFrameBarManager and override SetUserVisibilityPreferenceInBar method, which gets triggered when a BarItem is hidden using "Add or Remove Buttons" context menu.
public class CustomBarManager : MainFrameBarManager
{
public override void SetUserVisibilityPreferenceInBar (BarItem barItem, Bar bar, bool showOrHide)
{
if (!showOrHide)
{
Console.WriteLine(barItem.Text);
}
base.SetUserVisibilityPreferenceInBar(barItem, bar, showOrHide);
}
}
Please let me know if this helps you.
Regards,
Mano
sample.zip
AD
Administrator
Syncfusion Team
May 12, 2006 11:22 PM UTC
Thanks for the reply. This gets me part of what I need.
Is there a way to duplicate the QuickCustomize hiding of BarItems in code?
MJ
Mano J
Syncfusion Team
May 23, 2006 03:18 PM UTC
Hi Don,
Sorry for this late reply. You can directly use MainFrameBarManager''s SetUserVisibilityPreferenceInBar method to show/hide BarItems in a bar through code.
this.mainFrameBarManager1.SetUserVisibilityPreferenceInBar(this.barItem4, this.bar2, false);
Please let me know if this helps you.
Regards,
Mano
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
AD Administrator
- May 9, 2006 07:47 PM UTC
- May 23, 2006 03:18 PM UTC