The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team July 9, 2004 05:09 PM UTC
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
TJTJJuly 9, 2004 07:05 PM UTC
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