This is a migrated thread and some comments may be shown as answers.

More RadRibbonBar issues

2 Answers 47 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
DukeVideo
Top achievements
Rank 1
DukeVideo asked on 09 Jan 2008, 04:51 PM
Hi,

I am finding more basic issues with the RadRibbonBar.

Please consider the following code:

foreach (WebSite webSite in LookupManager.WebSites)  
            {                 
                RadMenuItem radMenuItem = new RadMenuItem(webSite.WSit_Name.Trim(), webSite);  
                radMenuItem.Click += new EventHandler(radMenuItem_Click);  
 
                if (webSite.WSit_IsEnabled)  
                {  
                    RadMenuItem radSubMenuItem = new RadMenuItem("Web Site Content");  
                    radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                    radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WorldStockItem);  
                    radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                    radMenuItem.Items.Add(radSubMenuItem);  
 
                    if (webSite.WSit_AllowAutoPush)  
                    {  
                        RadMenuItem radSubMenuItem = new RadMenuItem("Publish Stock Item to Web Site");  
                        radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                        radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WebSiteStockItemPublisher);  
                        radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                        radMenuItem.Items.Add(radSubMenuItem);  
                    }  
                    if (webSite.WSit_HasAdminTools)  
                    {  
                        RadMenuItem radSubMenuItem = new RadMenuItem("Extranet Tools");  
                        radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                        radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.Configure);  
                        radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                        radMenuItem.Items.Add(radSubMenuItem);  
                    }  
                    if (webSite.WSit_IsSitecore)  
                    {  
                        RadMenuItem radSubMenuItem = new RadMenuItem("Sitecore");  
                        radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                        radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.Sitecore);  
                        radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                        radMenuItem.Items.Add(radSubMenuItem);  
                    }  
 
                    RadMenuItem radWebSiteDetailsMenuItem = new RadMenuItem("Web Site Details");  
                    radWebSiteDetailsMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                    radWebSiteDetailsMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WorldMagnify);  
                    radWebSiteDetailsMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                    radMenuItem.Items.Add(radWebSiteDetailsMenuItem);  
 
                    RadMenuItem radWebSiteBrowseMenuItem = new RadMenuItem("Browse Web Site");  
                    radWebSiteBrowseMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
                    radWebSiteBrowseMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.InternetExplorer);  
                    radWebSiteBrowseMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
                    radMenuItem.Items.Add(radWebSiteBrowseMenuItem);  
 
                }  
 
                try 
                {  
                    radMenuItem.ShowArrow = true;  
                }  
                catch (Exception ex)  
                {  
 
                }  
 
                try 
                {  
                    radMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.World);  
                }  
                catch (Exception ex)  
                {  
 
                }  
 
                radRibbonBarWebSiteDropDownButton.Items.Add(radMenuItem);  
            }  
 

Notice the try {} blocks? Well I have to do that, otherwise a NullReferenceException is thrown on both methods. Bizarrely, the image setting works, even though the exception was thrown. I've previously seen this when setting the colour of a contextual tab group.

Any progress on automatically setting (or even programmatically being able to do it) the first contextual tab when a contextual tab appears?

2 Answers, 1 is accepted

Sort by
0
DukeVideo
Top achievements
Rank 1
answered on 09 Jan 2008, 04:57 PM
Furthermore, I forgot to add, the ShowArrow property does not work. I would like this to work, if possible.

Thanks
0
Jack
Telerik team
answered on 10 Jan 2008, 11:55 AM
Hi Nathan,

Thank you for reporting these issues.

Please, excuse us for the inconvenience. We will address these issues in our upcoming release. Don't hesitate to contact us if you have other questions.

All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
RibbonBar
Asked by
DukeVideo
Top achievements
Rank 1
Answers by
DukeVideo
Top achievements
Rank 1
Jack
Telerik team
Share this question
or