C1Ribbon color picker for C1Flexgrid?

Posted by: hdle on 24 January 2022, 3:17 am EST

    • Post Options:
    • Link

    Posted 24 January 2022, 3:17 am EST

    Is there a way to use the ribbon’s Office-like color picker in the C1Flexgrid control?

    I need a user color selector in the grid, but the MS ColorEditor is so outdated.

    Thanks,

    Hai

  • Posted 24 January 2022, 8:13 pm EST

    Hi,

    You can use the C1ColorPicker as the editor or create your own custom editor and then use it in the FlexGrid.

    Please refer to the “CustomEditors” sample at https://github.com/GrapeCity/ComponentOne-WinForms-Samples/tree/master/NetFramework/FlexGrid/CS/CustomEditors, it shows how you can use different types of custom editors in FlexGrid. You can also refer to the documentation at https://www.grapecity.com/componentone/docs/win/online-flexgrid/cell-editors.html.

    Regards

    Avnish

  • Posted 25 January 2022, 3:45 am EST

    Hi Avnish,

    I completely forgot about that control. It works.

    Quick question: Do you know how to make the color selection open on a menustrip button? I tried the following but it opens at point 0,0.

    
          private void tsBackColor_Click(object sender, EventArgs e)
          {
             var backColorPicker = new C1ColorPicker();
             backColorPicker.Location = toolStrip1.PointToScreen(new Point(tsBackColor.Bounds.X, tsBackColor.Bounds.Y));
             backColorPicker.OpenDropDown();
          }
    
    

    Thanks,

    Hai

  • Posted 25 January 2022, 3:53 am EST

    I figured it out…

          
          private void tsBackColor_Click(object sender, EventArgs e)
          {
             var backColorPicker = new C1ColorPicker();
             var point = toolStrip1.PointToScreen(new Point(tsBackColor.Bounds.X, tsBackColor.Bounds.Y));
             backColorPicker.DropDownForm.SetDesktopLocation(point.X, point.Y + toolStrip1.Height);
             backColorPicker.OpenDropDown();
          }
    
    

    Thanks again for your help.

    Hai

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels