We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Docking RibbonBar to the right side in a DLL

Thread ID:

Created:

Updated:

Platform:

Replies:

130532 May 17,2017 09:21 AM UTC May 19,2017 12:05 PM UTC WPF 3
loading
Tags: Ribbon
Dov
Asked On May 17, 2017 09:21 AM UTC

Hi,

I'm setting my RibbonTabs from a class library at runtime.

I've tried to use your example from here: https://www.syncfusion.com/kb/5789/how-to-dock-ribbonbar-at-the-right-side

One of the RibbonTabs has RibbonBars in it and as a collapseRibbonBar aswell.

I set
SizeChanged="ribbon_SizeChanged" in the MainWindow where the Ribbon exist.

In there I write the code:

            double width = 0;

            try
            {
                RibbonTabItemsControl ribbontabitem = VisualUtils.FindDescendant( this, typeof( RibbonTabItemsControl ) ) as RibbonTabItemsControl;

                foreach( Button item in VisualUtils.EnumChildrenOfType( ribbontabitem, typeof( Button ) ) )
                {
                    width = item.ActualWidth;
                }

                if( AdvancedDll != null )
                {
                    AdvancedDll.RibbonSizeChanged( ribbontabitem.ActualWidth, width );
                }
            }
            catch( Exception ex )
            {
                WriteToLogFile( "Error: " + ex.ToString() );
            }


And if AdvancedDll exist I enter the
RibbonSizeChanged. 
 
RibbonSizeChanged (In the DLL):


        public void RibbonSizeChanged( double TabActualWidth, double width )
        {
            try
            {
                Measure( new Size() );

                collapseRibbonBar.Width = TabActualWidth - ( ModeBar.ActualWidth + ImportExportBar.ActualWidth + ConfigBar.ActualWidth
                + StandardBar.ActualWidth + ToolsBar.ActualWidth + ViewBar.ActualWidth + MarkersBar.ActualWidth + DownloadBar.ActualWidth )
                - width + 7;
            }
            catch( Exception )
            {

            } 
        }


I don't set Width to the RibbonBars in my class library because I want my application to look the same on different screen resolutions so the
ActualWidth that I received is 0 (that is why I tried to use Measure( new Size() ); but with no success).

In the MainWindow the window state is set to maximized, and it seems that Measure won't work until I resize my window, then I'll get

ActualWidth to all RibbonBars, but still the result looks funny.

I've added a sample video to show you the problem.

Is there a way to fix this issue?

Regards,

Dov.




Attachment: 1_14fa2ae2.rar

Keerthana Jegannathan [Syncfusion]
Replied On May 18, 2017 12:19 PM UTC

Hi Dov,   
   
Thank you for contacting Syncfusion support.   
   
We have checked the reported behavior by creating a simple sample with your shared code and we were unable to reproduce the reported behavior from our side. We can see the space in the right side of the RibbonBar, we have prepared sample and video for your reference and it can be downloaded from the below location.   
   
Sample: RibbonDemoSample   
   
Video: RibbonCollapse   
   
Can you check with the above video and sample for the scenario we have checked and let us know if we misunderstood your query? If so, then can you share the simple sample which replicates the issue which will be helpful for us to analyze and provide the solution at earliest.   
   
Regards,   
Keerthana J   


Dov
Replied On May 18, 2017 01:27 PM UTC

Hi Keerthana,

Thank you for your fast reply.

You understood the problem, the space on the right side is the problem.

I would like the RibbonBar named: DownloadBar to be docked to the right at all time, without any space, even if I change the window state.

There is a great solution by Syncfusion: Solution (please see sample code in the last comment by M.Sugapriya).

But I can't seem to get it to work properly from a DLL.


Regards,

Dov.




Keerthana Jegannathan [Syncfusion]
Replied On May 19, 2017 12:05 PM UTC

Hi Dov,   
   
Thanks for explaining your requirement.   
    
We have modified the sample in which we have iterated through the RibbonBar’s of the HomeTab and based on its width we have updated the margin of the RibbonBar which is present at the end of RibbonTab in SizeChanged event of the Ribbon. It can be downloaded from the below location.   
   
Sample: RibbonDemo   
   
Regards,   
Keerthana J  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;