dbgrideh 中checkbox列,灰色状态时处理从未选中状态
查看ehgrid源码
procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
.......
//modify by mofen
if CheckBoxGrayAsUnChecked and (Column.CheckboxState = cbGrayed) then
begin
//如果是灰色状态
PaintButtonControl {Eh}(Canvas.Handle, ARect1, Canvas.Brush.Color, bcsCheckboxEh,
0, Flat, False, True, cbUnchecked
);
end else
begin
//DrawCheck(Canvas.Handle,ARect1,Column.CheckboxState,True,Flat);
PaintButtonControl {Eh}(Canvas.Handle, ARect1, Canvas.Brush.Color, bcsCheckboxEh,
0, Flat, False, True, Column.CheckboxState
);
end;