'cross-hair'-highlight of selected cell in ExpressQuantumGrid

238 Views Asked by At

I have a large grid with both many rows and many narrow columns. I want want to make it easier to see what column is selected by highlighting the current column in the same way that the current row is highlighted.

I tried using the GetContentStyle event, but it seems that only the selected row is repainted, so it didn't work that great...

Do anyone have an idea how to highlight the selected column in a ExpressQuantumGrid?

1

There are 1 best solutions below

0
On

The solution that I have ended up with, is to force a repaint whenever the focus is moved between columns. This is not a solution that I like... At least it should be able to invalidate only relevant columns....

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;