Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
How to add Recent Files to Ribbon Toolbar?
posted

I've been working with the Ribbon Toolbar and I'm slowly figuring things out.  Unfortunately, I do find, more often than not, that the Ribbon control departs from the usual way of implementation collections.  Things seem a LOT harder to code because simple collections simply do not exist  as one would expect.

At this point, I managed to create an Application Menu (I think that's correct) in the top left hand corner of my window off of the round button object.  From there, I have a drop down pane that is split in 2 parts.  The left part is about 40% wide and this is where I've created my New Case, Open Case, Close Case (etc.) Button Tools.  In the right pane (60%), it is blank.  This is where I want to create my recently used files list.

You would think that it might be as simple as Toolbar > Ribbon > ApplicationMenu > Items.Add(xxxx)  but this is not true.  This collection does not exist.

I've poured over the forums and online documentation and Google and i will be darned if I can figure this out.

Does anyone have any sample code? 

PS:  I'm using 2011.4 Infragistics WinForms

Thanks.

  • 23930
    Offline posted

    Hi John,

    Thank you for posting in our forums.

    The UltraToolbarsManger’s ApplicationMenu has two collections where you can put the buttons that it will display. They are named ToolAreaLeft and ToolAreaRight and are responsible for the ApplicationMenu’s left and the right area respectively. So you can add tools to the left are using code like:

                ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaLeft.Tools.AddToolRange(new string[] { "NewCase", "OpenCase", "CloseCase" });

    And to the right area using the following code:

                ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaRight.Tools.AddToolRange(new string[] { "RecentFile1", "RecentFile2", "RecentFile3" });

    Note that for this operation to be successful you need to first add the tools themselves to the UltraToolbarsManger Tools collection.

    I have attached a small sample which demonstrates this suggestion.

    Please let me know if you have any additional questions.

    WTM_AddToolsToRightMenu.zip