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
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; } }}
Hi Mike
Thank you - this is exactly what I was looking for. I have a follow-up question. When tool is disabled, the gallery item is not greyed out. Do I have to provide an appropriate image for this?
Solution and Database Architect