Please help with InRibbonGallery

Sep 23, 2010 at 1:50 PM

Hi all,

 

I am trying to create a InRibbonGallery with items in it from code (not xaml). I tried for a long time and still did not get it. Here are my code sample, can you all please let me know how to do it. Any sample code will be appreciated:

 

InRibbonGallery gl = new InRibbonGallery();
RibbonListBox listBox = new RibbonListBox();
ListBox.Items.Add(new Fluent.Button());
gl.Items.Add(listBox);
ribbonGroupBox.Items.Add(gl);
I can only see the gallery with nothing in it. Please help me...
Thanks
Coordinator
Sep 23, 2010 at 2:24 PM

Try  the following code:

InRibbonGallery gallery = new InRibbonGallery();
Fluent.Button a = new Fluent.Button();
a.Width = a.Height = 56;
a.Text = "A";
Fluent.Button b = new Fluent.Button();
b.Width = b.Height = 56;
b.Text = "B";
gallery.Items.Add(a);
gallery.Items.Add(b);
ribbonGroupBox.Items.Add(gallery);

Sep 23, 2010 at 2:30 PM

Hi daVinci,

That is quick response. Thanks

I am trying it using one of the snapshot (not the 1.3 official release). It tunes out to be the same outcome.  I am using the FluentTest as test bed and here is the snapshot of code and UI.

Do you see anything wrong?

Best regards

Yong

From: daVinci [mailto:notifications@codeplex.com]
Sent: Thursday, September 23, 2010 8:25 AM
To: Yongdong Zeng
Subject: Re: Please help with InRibbonGallery [fluent:228321]

From: daVinci

Try the following code:

InRibbonGallery gallery = new InRibbonGallery();
Fluent.Button a = new Fluent.Button();
a.Width = a.Height = 56;
a.Text = "A";
Fluent.Button b = new Fluent.Button();
b.Width = b.Height = 56;
b.Text = "B";
gallery.Items.Add(a);
gallery.Items.Add(b);
ribbonGroupBox.Items.Add(gallery);

Read the full discussion online.

To add a post to this discussion, reply to this email (fluent@discussions.codeplex.com)

To start a new discussion for this project, email fluent@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Sep 23, 2010 at 3:27 PM

Please, upload the screenshot somewhere...

Sep 23, 2010 at 7:18 PM

Hi,

The following code work in 1.3 release(However the tab style has a bug, which affects all other tabs). But similar code failed to work on Fluent-53511. There must be some changes break the gallery.

           

            InRibbonGallery gl = new InRibbonGallery();
gl.Name = "inRibbonGallery";
gl.MinItemsInRow = 1;
gl.MaxItemsInRow = 5;
//gl.Icon = "Images\\Gray.png";
gl.Text = "Grouped";
gl.ItemWidth = 50;
gl.ItemHeight = 18;
gl.ItemTemplate =(DataTemplate) TryFindResource("middleDataItemTemplate");
gl.GroupBy = "Group";
gl.ResizeMode = ContextMenuResizeMode.Both;
gl.ItemsSource = this.DataItems;

ribbonGroup.Items.Add(gl);

I am waiting for the next stable release. Do you have any date?

Thanks

From: daVinci [mailto:notifications@codeplex.com]
Sent: Thursday, September 23, 2010 8:25 AM
To: Yongdong Zeng
Subject: Re: Please help with InRibbonGallery [fluent:228321]

From: daVinci

Try the following code:

InRibbonGallery gallery = new InRibbonGallery();
Fluent.Button a = new Fluent.Button();
a.Width = a.Height = 56;
a.Text = "A";
Fluent.Button b = new Fluent.Button();
b.Width = b.Height = 56;
b.Text = "B";
gallery.Items.Add(a);
gallery.Items.Add(b);
ribbonGroupBox.Items.Add(gallery);

Read the full discussion online.

To add a post to this discussion, reply to this email (fluent@discussions.codeplex.com)

To start a new discussion for this project, email fluent@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com