Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Problems with Recent Documents Collapse All
Subject Author Date
Helmut Wahrmann Sep 3, 2010 - 6:54 AM

I’ve got some problems using Recent Docume nts using version 3.7:

1. Doing an insert programmatically. I want to have the new item on top of the list:

recentDocuments.Items.Insert(0, "new.docx");

I would imagine that this is inserting at the top of the list. However it inserts at the bottom.


2. I have an App Menu with 3 Menu items in the left pane.
When i insert now items at the Right Pane, the Recent Documents, i only see 2 of them + the Caption for the right pane.

It doesn’t resize, altough SizeToContentMode = WidthAndHeight

3. Because of the problem mentioned above, i change SizeToContentMode = Width
This is done within Designer. And i set the Height = 300.
This gives now the App Menu a fixed height.

i now add items to the component, in the ctor of the app:

recentFolders.Caption = "Recent Folders";
recentFolders.Items.Add("first");
recentFolders.Items.Add("second");
recentFolders.Items.Add("third");
recentFolders.Items.Add("fourth");
applicationMenu1.RightPaneControl = recentFolders;


Opening the appMenu after startup shows an empty right pane. Not even the Caption is shown.
Only if i insert a new item with the command shown in 1) the list is refreshed.
However the new item is not shown at top, but at bottom

thanks for looking into this.

regards,

Helmut

Technical Support Sep 7, 2010 - 1:31 AM

In the next version we will introduce a new PinList control that should have better functionality and replace the RecentDocumentsControl. Meanwhile you can apply the workaround as follows:

        private void Form1_Load(object sender, EventArgs e)
        {
            RecentDocumentsControl recentDocumentsControl = new RecentDocumentsControl();
            recentDocumentsControl.Items.Add("This is a test.docx");
            recentDocumentsControl.Items.Add("This is a test1.docx");
            recentDocumentsControl.Items.Add("This is a test2.docx");
            applicationMenu1.RightPaneControl = recentDocumentsControl;
            applicationMenu1.ContentMinimumHeight = 350;
            applicationMenu1.VisibleChanged += ApplicationMenu_VisibleChanged;
        }

        private void ApplicationMenu_VisibleChanged(object sender, EventArgs e)
        {
            applicationMenu1.RightPaneControl.Control.Controls[0].PerformLayout();
        }
The most important in this code snippet is the ApplicationMenu_VisibleChanged method which should make your code work properly.

Helmut Wahrmann Sep 7, 2010 - 11:03 AM

Worked. Thanks