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

If not UpdateUI, then what event?

Hi. I see in the documentation for the BarItem.UpdateUI event that this event should be used only if certain conditions are met. Otherwise... It doesn''t suggest what event I should use. I''d like to dynamically enable my XPMenu items in some sort of event handler, if possible. An "OnGetMenuState" event, or whatever, but I can''t find any such event. Is there one? (Version 2.0.5.1) Thanks, Tom

2 Replies

AD Administrator Syncfusion Team July 9, 2004 01:09 PM

Hi TJ Can you post some more information on your requirements. Specifically, when do you want to want to enable the items in your Menu(s): For example is it when you click on the ParentBarItem? Regards Arun


TJ TJ July 9, 2004 03:05 PM

Hi, Arun. Here''s a typical scenario: I''ve got a lot of menu items that should be enabled only if I have a file open. Right now I''m doing it like this: this.MenuClose.UpdateUI += new EventHandler (MenuEnableIfFileOpen); this.MenuPrint.UpdateUI += new EventHandler (MenuEnableIfFileOpen); ... private void MenuEnableIfFileOpen (object sender, EventArgs e) { BarItem menu = sender as BarItem; if (menu != null) menu.Enabled = this.IsFileOpen; } But I''ve been looking for another event to use instead of UpdateUI. The documentation for UpdateUI suggests using another technique in most cases, but is vague on what that technique might be. I''m thinking of something like "OnAboutToShowMenu", but I don''t think that exists... Ah, but that won''t work if the menus (um, BarItems) are shown on a toolbar, will it? Okay, now I understand why there isn''t such an event... I think I''ll stay with the UpdateUI technique, then. No problem. Thanks, Tom

Loader.
Live Chat Icon For mobile
Up arrow icon