More RadRibbonBar issues

3 posts, 0 answers
  1. DukeVideo
    DukeVideo avatar
    48 posts
    Member since:
    Jun 2006

    Posted 09 Jan 2008 Link to this post

    Hi,

    I am finding more basic issues with the RadRibbonBar.

    Please consider the following code:

    1 foreach (WebSite webSite in LookupManager.WebSites)  
    2             {                 
    3                 RadMenuItem radMenuItem = new RadMenuItem(webSite.WSit_Name.Trim(), webSite);  
    4                 radMenuItem.Click += new EventHandler(radMenuItem_Click);  
    5  
    6                 if (webSite.WSit_IsEnabled)  
    7                 {  
    8                     RadMenuItem radSubMenuItem = new RadMenuItem("Web Site Content");  
    9                     radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    10                     radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WorldStockItem);  
    11                     radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    12                     radMenuItem.Items.Add(radSubMenuItem);  
    13  
    14                     if (webSite.WSit_AllowAutoPush)  
    15                     {  
    16                         RadMenuItem radSubMenuItem = new RadMenuItem("Publish Stock Item to Web Site");  
    17                         radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    18                         radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WebSiteStockItemPublisher);  
    19                         radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    20                         radMenuItem.Items.Add(radSubMenuItem);  
    21                     }  
    22                     if (webSite.WSit_HasAdminTools)  
    23                     {  
    24                         RadMenuItem radSubMenuItem = new RadMenuItem("Extranet Tools");  
    25                         radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    26                         radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.Configure);  
    27                         radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    28                         radMenuItem.Items.Add(radSubMenuItem);  
    29                     }  
    30                     if (webSite.WSit_IsSitecore)  
    31                     {  
    32                         RadMenuItem radSubMenuItem = new RadMenuItem("Sitecore");  
    33                         radSubMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    34                         radSubMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.Sitecore);  
    35                         radSubMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    36                         radMenuItem.Items.Add(radSubMenuItem);  
    37                     }  
    38  
    39                     RadMenuItem radWebSiteDetailsMenuItem = new RadMenuItem("Web Site Details");  
    40                     radWebSiteDetailsMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    41                     radWebSiteDetailsMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.WorldMagnify);  
    42                     radWebSiteDetailsMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    43                     radMenuItem.Items.Add(radWebSiteDetailsMenuItem);  
    44  
    45                     RadMenuItem radWebSiteBrowseMenuItem = new RadMenuItem("Browse Web Site");  
    46                     radWebSiteBrowseMenuItem.FitToSizeMode = RadFitToSizeMode.FitToParentContent;  
    47                     radWebSiteBrowseMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.InternetExplorer);  
    48                     radWebSiteBrowseMenuItem.TextImageRelation = TextImageRelation.ImageBeforeText;  
    49                     radMenuItem.Items.Add(radWebSiteBrowseMenuItem);  
    50  
    51                 }  
    52  
    53                 try 
    54                 {  
    55                     radMenuItem.ShowArrow = true;  
    56                 }  
    57                 catch (Exception ex)  
    58                 {  
    59  
    60                 }  
    61  
    62                 try 
    63                 {  
    64                     radMenuItem.Image = LookupManager.GetImage(LookupManager.ImageKey.World);  
    65                 }  
    66                 catch (Exception ex)  
    67                 {  
    68  
    69                 }  
    70  
    71                 radRibbonBarWebSiteDropDownButton.Items.Add(radMenuItem);  
    72             }  
    73  

    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. DukeVideo
    DukeVideo avatar
    48 posts
    Member since:
    Jun 2006

    Posted 09 Jan 2008 Link to this post

    Furthermore, I forgot to add, the ShowArrow property does not work. I would like this to work, if possible.

    Thanks
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 10 Jan 2008 Link to this post

    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
Back to Top