Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
920
How to disable gallery item in PopuMenuToolGallery
posted

Hi

I have a number of reports displayed as gallery items in a PopupGalleryTool on a Office 2007 style ribbon.  I would like to disable some reports based on whether the user has the necessary permissions to view the report.

Is it possible to disable a gallery item and if so how do I set the property?

Any help greatly appreciated.

Regards

James O'Doherty

Solutions and Database Architect

WINSQL Ltd

Parents
No Data
Reply
  • 12480
    Offline posted

    Hi James,

    You can check the user's permissions in the BeforeToolDropdown event and disable the reports to which he or she does not have access. The following code can accomplish this:

    private void ultraToolbarsManager1_BeforeToolDropdown(object sender, Infragistics.Win.UltraWinToolbars.BeforeToolDropdownEventArgs e)
    {
       if (e.Tool.Key == "PopupGalleryTool1")
       {
          PopupGalleryTool popup = e.Tool as PopupGalleryTool;
         
    foreach (ToolBase tool in popup.Tools)
         
    {
             bool bHasPermission = CheckPermisson(tool);
             tool.SharedProps.Enabled = bHasPermission;
          }
       }
    }

Children