[英]Add an individual column to cxGrid and use for selection purposes (checkbox)
[英]cxGrid selection - avoid selecting one particular column
当您在cxGrid中选择一行时,整个行都会被选中(将颜色更改为蓝色)。 我怎样才能告诉网格不要从某一列中选择记录,即使其保持无色? 我尝试了数据集的后滚动使用:
cxGrid1dbTableView1.GetColumnByFieldName('MYFIELD').Focused := True;
但是不起作用.....
使用要更改的列的OnCustomDrawCell
事件并将此代码放入其中:
if AViewInfo.Selected then
begin
ACanvas.Brush.Color := clWindow;
ACanvas.Font.Color := clWindowText;
end;
就我而言,我没有使用任何主题,因此颜色匹配。 如果您使用其他内容,则必须相应地进行更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.