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

List Recent Documents in Menu

3 Answers 257 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 25 Nov 2009, 04:46 PM
Hello,

I was wondering if there are any examples of how to list recently opened documents by my app in the ribbon menu?  I am using C# .net 3.5.

Thanks,
Dave

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 30 Nov 2009, 11:32 AM
Hello Dave,

Creating a most recent documents list is a task which can depend on many things related to the application you develop. We do not have such an example since it would be nothing more that inserting items in the RadApplicationMenu items collection:

RadMenuItem menuItem = new RadMenuItem();
menuItem.Text = @"C:\Document.txt";
this.radApplicationMenu1.RightColumnItems.Add(menuItem);

Also when this happens depends entirely on the design and organization of your application. For instance, you can insert items in this collection each time the user opens a document and you can keep track of the last 10 opened documents etc.

Regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Matt
Top achievements
Rank 1
answered on 20 Sep 2010, 08:44 PM
So I understand this, but how do you handle the click event for that item since it is being dynamically created? Usually I use the IDE to handle adding click events, I don't know how to do it for dynamically added items.
0
Peter
Telerik team
answered on 23 Sep 2010, 01:06 PM
Hi Matt,

Thanks for writing.

You should programmatically subscribe to the MouseClick event in this case:
Please refer to the code snipped below:

RadMenuItem menuItem = new RadMenuItem();
menuItem.Text = @"C:\Document.txt";
menuItem.Click += new EventHandler(menuItem_Click);
this.radApplicationMenu1.RightColumnItems.Add(menuItem);
...
void menuItem_Click(object sender, EventArgs e)
{
 //do some operation with this Sender
    if(((RadMenuItem)sender).Text==@"C:\Document.txt")
    {
      //open this file
    }
}

I hope this helps.

 

Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RibbonBar
Asked by
Dave
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Matt
Top achievements
Rank 1
Peter
Telerik team
Share this question
or