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

Changing height of RadRibbonView

3 Answers 176 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 10 Sep 2013, 03:21 PM
Hi, 

I would like to allow the user to choose between a 'large' and 'small' ribbonview by dynamically changing the height of the ribbonview.  Mostly everything is working as expected.  The ribbonview initially loads correctly when set to either 'large' or 'small'.  And the ribbonview switches from 'large' to 'small' with no issues.  The problem that I'm running into is switching from the 'small' ribbonview to large.  When I do this the button text is formatted incorrectly.  I have attached a screenshot of the ribbonview with incorrectly formatted buttons.  I have also included the code that resizes the ribbonview.  I saw that out of the box changes to the ribbonview height was included in the 2013 Q1 Silverlight Controls.  Is the incorrect button formatting a bug in the control or an issue with my code.

Thanks,

Daniel A
   
protected void ResizeRibbonBar(UserConfiguration.RibbonBarStyleType? ribbonBarStyle)
        {
            int buttonHeight;
            int buttonHeightStacked;
            int groupHeight;
            int ribbonBarHeight;
 
            Visibility applicationButtonVisibility;
            Visibility titleBarVisibility;
            Visibility homeTabVisibility;
 
            ButtonSize homeButtonSize;
            ButtonSize documentButtonSizeOne;
            ButtonSize documentButtonSizeTwo;
 
            VerticalAlignment groupVerticalAlignment;
            Thickness topMargin;
 
            this.ribbonStyle = ribbonBarStyle;
 
            if (ribbonBarStyle == UserConfiguration.RibbonBarStyleType.Small)
            {
                buttonHeight = 20;
                buttonHeightStacked = 20;
                groupHeight = 47;
                ribbonBarHeight = 57;
 
                topMargin = new Thickness(0, 5, 0, 0);
 
                titleBarVisibility = Visibility.Collapsed;
                applicationButtonVisibility = Visibility.Collapsed;
                homeTabVisibility = Visibility.Collapsed;
                homeButtonSize = ButtonSize.Medium;
                groupVerticalAlignment = VerticalAlignment.Top;
            }
            else
            {
                buttonHeight = 67;
                buttonHeightStacked = 25;
                groupHeight = 91;
                ribbonBarHeight = 135;
 
                topMargin = new Thickness(0, 0, 0, 0);
 
                titleBarVisibility = Visibility.Visible;
                applicationButtonVisibility = Visibility.Visible;
                homeTabVisibility = Visibility.Visible;
                homeButtonSize = ButtonSize.Large;
                groupVerticalAlignment = VerticalAlignment.Stretch;
            }
 
            //resize ribbonbar
            this.ribbonView.Height = ribbonBarHeight;
 
            //set margin above ribbonbar
            this.homeRibbonTab.Margin = topMargin;
 
            //set application button and title bar visiblity
            this.ribbonView.ApplicationButtonVisibility = applicationButtonVisibility;
            this.ribbonView.TitleBarVisibility = titleBarVisibility;
 
            ////hides upper tab bar
            this.homeRibbonTab.HeaderVisibility = homeTabVisibility;
 
            //resizes home ribbon bar buttons
            this.homeTabNewDocumentButton.Size = homeButtonSize;
            this.homeTabCreateBatchButton.Size = homeButtonSize;
            this.homeTabOpenBatchButton.Size = homeButtonSize;
            this.homeTabUserSettings.Size = homeButtonSize;
            this.homeHelp.Size = homeButtonSize;
            this.homeRefresh.Size = homeButtonSize;
            this.homeLogout.Size = homeButtonSize;
 
            this.homeTabNewDocumentButton.Height = buttonHeight;
            this.homeTabCreateBatchButton.Height = buttonHeight;
            this.homeTabOpenBatchButton.Height = buttonHeight;
            this.homeTabUserSettings.Height = buttonHeight;
            this.homeHelp.Height = buttonHeight;
            this.homeRefresh.Height = buttonHeight;
            this.homeLogout.Height = buttonHeight;
 
            //resize home ribbon tab groups
            foreach (RadRibbonGroup group in this.homeRibbonTab.Items)
            {
                group.Height = groupHeight;
                group.VerticalAlignment = groupVerticalAlignment;
            }
        }

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 13 Sep 2013, 12:41 PM
Hi Daniel,

I am happy to inform you that there is straightforward way to achieve your requirement. You can use the ContentHeight property. The default value is 86 pixels and you can change it dynamically.

On the other hand can you please clarify which version of our dlls you use. I can not see any downloading records in your account.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Daniel
Top achievements
Rank 1
answered on 13 Sep 2013, 01:19 PM
Hi Pavel,

I change my code to use the ContentHeight property.  It is more straight forward.  However I am still seeing the same problem described above.  I am using version (2013.2.611.1050) of the Silverlight telerik controls.

Thanks, 

Daniel A
0
Pavel R. Pavlov
Telerik team
answered on 18 Sep 2013, 12:09 PM
Hi Daniel,

Can yo please try our latest release out. We managed to fix similar issues, lately.

Let us know if you still can reproduce this behavior with the latest official release.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RibbonView and RibbonWindow
Asked by
Daniel
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or