delphi - “十字线”-ExpressQuantumGrid 中选定单元格的突出显示

标签 delphi devexpress quantumgrid

我有一个大网格,其中有很多行和很多窄列。我希望通过以与突出显示当前行相同的方式突出显示当前列来更轻松地查看选择了哪列。

我尝试使用 GetContentStyle 事件,但似乎只有选定的行被重新绘制,所以效果不太好...

有人知道如何在 ExpressQuantumGrid 中突出显示所选列吗?

最佳答案

我最终得到的解决方案是每当焦点在列之间移动时强制重新绘制。这不是我喜欢的解决方案...至少它应该能够仅使相关列无效...

procedure TForm1.gridViewStylesGetContentStyle(
  Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
  AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
begin
  if (AItem is TcxGridBandedColumn) and
     (Sender.Controller.FocusedItem = AItem) then
  begin
    AStyle := DataManager.cxStyleSelected
  end;
end;

procedure TForm1.gridViewByGoalFocusedItemChanged(
  Sender: TcxCustomGridTableView; APrevFocusedItem,
  AFocusedItem: TcxCustomGridTableItem);
begin
  Sender.Invalidate(true);
end;

关于delphi - “十字线”-ExpressQuantumGrid 中选定单元格的突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23612969/

相关文章:

delphi - DevExpress 量子网格简单指南

delphi - 将参数传递给delphi TFrame

.net - 如何诊断 COM 可调用包装对象创建失败?

Delphi快速大位图创建(无需清除)

sorting - Delphi XE2 按文件名对 Tstringlist 进行排序

DevExpress:我如何在没有许可证的情况下为其开发?

delphi - 在开发者表达组件 cxTreeView 中存储额外数据

c# - 如何解决变成 "ASPx is not defined"异常的 "potentially dangerous Request.Path"错误?