The code below should be working for SharedProps.Enabled but it doesn't. I think this is a bug in the latest Ribbon code. I have two examples below and neither work. Ideas? Help?
PopupMenuTool popupAnalysisInstance = mainRibbon.Ribbon.Tabs["Sales"].Groups["reports"].Tools["PopupAnalysis"] as PopupMenuTool; bool showTool = false;try{ showTool = ReportUtils.AuthorizeUserForReport( UserManager.Instance.RunAsUser.SamAccountName, reportToolMap[reportToolKey]);}catch (Exception) { } popupAnalysisInstance.Tools[reportToolKey].SharedProps.Enabled = showTool; //Setting Enable doesn't work...why?popupAnalysisInstance.Tools[reportToolKey].SharedProps.Visible= showTool; //Setting visible does work....Why??
try{ showTool = ReportUtils.AuthorizeUserForReport( UserManager.Instance.RunAsUser.SamAccountName, reportToolMap[reportToolKey]);}catch (Exception) { } popupAnalysisInstance.Tools[reportToolKey].SharedProps.Enabled = showTool; //Setting Enable doesn't work...why?
popupAnalysisInstance.Tools[reportToolKey].SharedProps.Visible= showTool; //Setting visible does work....Why??
ButtonTool aTool = mainRibbon.Tools[reportToolKey] as ButtonTool; if (aTool != null) { bool showTool = false; try { showTool = ReportUtils.AuthorizeUserForReport( UserManager.Instance.RunAsUser.SamAccountName, reportToolMap[reportToolKey]); } catch (Exception) { } aTool.SharedProps.Enabled = showTool; //This doesn't work...Why?? aTool.SharedProps.Visible = showTool; //This does work }
It looks like a bug to me. I would recommend submitting it to the support group: http://es.infragistics.com/gethelp.