ColorPicker in FlexGrid

Posted by: jimt on 12 December 2022, 1:27 pm EST

    • Post Options:
    • Link

    Posted 12 December 2022, 1:27 pm EST

    I downloaded the latest demo version of WinForms edition which includes C1ColorPicker. My earlier version did not have the ColorPicker component. I have used the following code in earlier versions to add other things to cells but now need a ColorPicker. The code below only shows the last cell added. Help please.

    private void Form2_Load(object sender, EventArgs e)

    {

    C1ColorPicker colorEdit = new C1ColorPicker();;

            _ = _sl.Add(new HostedControl(c1FlexGrid, colorEdit, 3, 3));
            _ = _sl.Add(new HostedControl(c1FlexGrid, colorEdit, 4, 4));
        }
    
        private void Form2_Paint(object sender, PaintEventArgs e)
        {
            foreach (HostedControl hosted in _sl)
            {
                _ = hosted.UpdatePosition();
            }
        }
    }
    
  • Posted 13 December 2022, 3:41 am EST

    Hi,

    To use the C1ColorPicker control as the Editor in the C1FlexGrid cells, you can use the Editor property of the Column. To further customize the cell appearance, you can handle the OwnerDrawCell event of the C1FlexGrid. Please see the attached sample for reference.

    Attachment: ColorPicker_Fg.zip

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels