EhLib.Com
https://forum.ehlib.com/en/

Checkbox: how to disable black square on null columns
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1013
Page 1 of 1

Author:  danieldavila [ 06 Dec 2019, 18:45 ]
Post subject:  Checkbox: how to disable black square on null columns

Is there a possibility to put a column set as "checkbox" so that if the value on field its null the checkbox will be like this Image
instead of like this? Image

Author:  EhLibSupport [ 06 Dec 2019, 19:09 ]
Post subject:  Re: Checkbox: how to disable black square on null columns

Hello

You can use TColumnEh.OnGetCallParams event to set CheckboxState before cell is drawn
like this:

Code:
procedure TForm1.DBGridEh1Columns7GetCellParams(Sender: TObject;
  EditMode: Boolean; Params: TColCellParamsEh);
begin
  if (Params.CheckboxState = TCheckBoxState.cbGrayed) then
    Params.CheckboxState := TCheckBoxState.cbUnchecked;
end;

Author:  danieldavila [ 06 Dec 2019, 19:26 ]
Post subject:  Re: Checkbox: how to disable black square on null columns

Thanks

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/