Adding two color pickers on a RibbonControlAdv within a ToolstripEx control

Hi,

I am having issues figuring out how to add two colorPickerAdv controls within a ToolstripEx on a RibbonControlAdv in Winforms. 

I need them in a vertical stack with overflow layout in the following order:

- Label1
- ColorPickerAdv1
- Label2
- ColorPickerAdv2

Your help would be highly appreciated.

Thank you.

5 Replies 1 reply marked as answer

VR Vijayalakshmi Roopkumar Syncfusion Team February 3, 2021 01:22 PM UTC

Hi Ivan, 
 
Thank you for contacting Syncfusion Support. 
 
We have checked your query and understood that you want to arrange the item in vertical stack with overflow mode . For this, you can use the LayoutStyle as VerticalStackWithOverflow and UseStandardLayout property of ToolStripPanelItem and added as ToolStripEx item as shown in below code: 
 
Code:[C#] 
 
 
this.toolStripPanelItem1.UseStandardLayout = true; 
this.toolStripPanelItem1.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow; 
this.toolStripPanelItem1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripLabel1, 
new ToolStripControlHost(this.colorPickerUIAdv1),this.toolStripLabel2, new ToolStripControlHost(this.colorPickerUIAdv2)}); 
 
 
 
 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 



IS Ivan Stankovic February 3, 2021 02:01 PM UTC

Not exactly what I mean. I am attaching you a screenshot that illustrates what I would like to achieve ideally in the ribbon. The color picker should be within a dropdown not visible unless the user clicks to select a color. Let me know if you have issues with the screenshot. Thank you for your prompt response.

Attachment: ColorPickersInRibbon_364b57a2.zip


VR Vijayalakshmi Roopkumar Syncfusion Team February 4, 2021 09:36 AM UTC

Hi Ivan 
 
Thank you for your update. 
 
We have checked your query and understood that you want to click a dropdown to select a color from ColorPickerUIAdv. For this, you can assign the ColorPickerUIAdv control to Dropdown control of ToolStripSplitButton and add this in ToolStripEx items as shown in the following code. For this, you need to derive the custom class and assign the ColorpickerAdv as shown in following code. 
 
Code:[C#] 
 
 
 
    //Custom DropDown class to set ColorPickerAdv in dropdown 
    public class CustomDropDown : ToolStripDropDown 
    { 
        public CustomDropDown(ColorPickerUIAdv colorpicker) 
        { 
            this.Height = colorpicker.Height; 
            this.Items.Add(new ToolStripControlHost(colorpicker)); 
        } 
    } 
 
 
 
 
Code shows assigning of ColorPicker to ToolStripSplitButton dropdown[C#] 
 
 
//Assign colorpicker to DropDown control of ToolStripSplitButton. 
this.toolStripSplitButton1.DropDown = new CustomDropDown(this.colorPickerUIAdv1); 
 
 
 
Please find the sample for the same for your reference 
 
 
Screenshot: 
 
 
 
 
Note: For overflow mode, you can reduce the size of RibbonControlAdv. 
 
Please try this suggestion and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 


Marked as answer

IS Ivan Stankovic February 4, 2021 08:16 PM UTC

Vijay I don't know how to thank you!

This is exactly what I needed. Fantastically awesome!

Deep gratitude!


VR Vijayalakshmi Roopkumar Syncfusion Team February 5, 2021 05:13 AM UTC

Hi Ivan 
 
We are glad that our solution helps you to achieve your requirement at your end. 
 
Please let us know if you need any other assistance on this. We will be happy to assist you. 
 
Regards, 
Vijayalakhmi VR 


Loader.
Up arrow icon