Jean-Marc Windholz
Top achievements
Rank 1
Jean-Marc Windholz
asked on 13 Oct 2010, 09:25 AM
Hi,
I'm using the StartMenuRightColumnItems collection for the Recent files list in a c# project and
I would reverse the order of the list, thus the last opened file is showed at the top of the list
and not al the bottom.
regards
I'm using the StartMenuRightColumnItems collection for the Recent files list in a c# project and
I would reverse the order of the list, thus the last opened file is showed at the top of the list
and not al the bottom.
regards
6 Answers, 1 is accepted
0
Emanuel Varga
Top achievements
Rank 1
answered on 13 Oct 2010, 09:48 AM
Hello Jean-Marc,
If i understood correctly, and you just want to reverse the items in a DataSource, you can just use Linq and use Reverse().
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
If i understood correctly, and you just want to reverse the items in a DataSource, you can just use Linq and use Reverse().
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
0
Jean-Marc Windholz
Top achievements
Rank 1
answered on 13 Oct 2010, 10:03 AM
Hello Emanuel,
I saw Reverse() but it doesn't make anything alone, and I don't know how I can
use Linq with StartMenuRightColumnItems
Best regards
I saw Reverse() but it doesn't make anything alone, and I don't know how I can
use Linq with StartMenuRightColumnItems
Best regards
0
Richard Slade
Top achievements
Rank 2
answered on 13 Oct 2010, 10:31 AM
Hi,
Does this help?
Edit: Converted from the following VB method
Let me know if you need further help
Richard
Does this help?
Form1_Load(System.Object sender, System.EventArgs e){ Telerik.WinControls.RadItemOwnerCollection s = default(Telerik.WinControls.RadItemOwnerCollection); s = this.RadRibbonBar1.StartMenuRightColumnItems; Array items = s.ToArray(); Array.Reverse(items); foreach (Telerik.WinControls.RadItem i in items) { MessageBox.Show(i.Text); }}Edit: Converted from the following VB method
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim s As Telerik.WinControls.RadItemOwnerCollection s = Me.RadRibbonBar1.StartMenuRightColumnItems Dim items As Array = s.ToArray() Array.Reverse(items) For Each i As Telerik.WinControls.RadItem In items MessageBox.Show(i.Text) NextEnd SubLet me know if you need further help
Richard
0
Emanuel Varga
Top achievements
Rank 1
answered on 13 Oct 2010, 10:36 AM
Hello Jean-Marc,
There must be an easier and better way of doing this, but this will do the trick:
Update... or this:
Hope this helps, if you have any other questions or comments, please let me know,
Offtopic: Sorry Richard for almost double posting, i really should remember refresh pages before posting...
Best Regards,
Emanuel Varga
There must be an easier and better way of doing this, but this will do the trick:
RadItem[] array = new RadItem[this.radRibbonBar1.StartMenuRightColumnItems.Count];this.radRibbonBar1.StartMenuRightColumnItems.CopyTo(array, 0);this.radRibbonBar1.StartMenuRightColumnItems.Clear();array = array.Reverse().ToArray<RadItem>();this.radRibbonBar1.StartMenuRightColumnItems.AddRange(array);Update... or this:
var array = this.radRibbonBar1.StartMenuRightColumnItems.Reverse().ToArray();this.radRibbonBar1.StartMenuRightColumnItems.Clear();this.radRibbonBar1.StartMenuRightColumnItems.AddRange(array);Hope this helps, if you have any other questions or comments, please let me know,
Offtopic: Sorry Richard for almost double posting, i really should remember refresh pages before posting...
Best Regards,
Emanuel Varga
0
Jean-Marc Windholz
Top achievements
Rank 1
answered on 13 Oct 2010, 02:12 PM
thank you Emanuel and Richard,
with your suggestions I solved all.
with your suggestions I solved all.
0
Richard Slade
Top achievements
Rank 2
answered on 13 Oct 2010, 02:16 PM
Glad that you got it sorted.
//Off Topic
@Emanuel - No problem about the double posting. It happens to me too. :o) - At least the question was answered
//Off Topic
@Emanuel - No problem about the double posting. It happens to me too. :o) - At least the question was answered