Skip to main content

Hiding individual checkboxes in a Checkbox column

Comments

1 comment

  • Dapfor Team

    Hi,
    You can do it by implementing your own editor that doesn’t paint text in cells. You can setup this editor in Grid.CellEditor event:


    grid1.CellEditor += delegate(object sender, GridCellEditableEventArgs e)
    {
    Row row = e.Cell.Row;
    Column column = e.Cell.Column;

    if (your conditions here)
    {
    e.Editor = new EmptyEditor();
    e.Editable = false;
    }
    };

    class EmptyEditor : UITypeEditorEx
    {
    public override bool GetPaintCellSupported()
    {
    return true;
    }

    public override void PaintCell(PaintCellEventArgs e)
    {
    e.Parts &= e.Parts ^ PaintPart.Text;
    base.PaintCell(e);
    }
    }



    Best regards,
    The Dapfor Team

    0

Please sign in to leave a comment.

Powered by Zendesk