I have a TNxDBGrid6, with columns that are databound, and one that is not that's an icon column. I'd like to show/hide the icon column cells based on the value of another hidden databound column within the same row of the grid.
it would look like this if it worked.
Date, Icon, (hidden column = x)
Date, NoIcon, (hidden column = y)
Date, Icon, (hidden column = x)
Date, Icon, (hidden column = x)
Date, Icon, (hidden column = x)
Date, NoIcon, (hidden column = z)
This is what I tried, but it didn't work. Even if the cell is Visible = False the icon is still shown.
Is there a way to do this?
procedure TFormNotesDlg.colIconSetCell(Sender: TObject; ACol, ARow: Integer; Cell: INxBaseCell); var DateCol, TypeCol: Integer; begin inherited; DateCol := Grd.Columns.ItemBy['colDisplayDate'].Index; Cell.Visible := False; TypeCol := Grd.Columns.ItemBy['colNoteType'].Index; if (Grd.Cell[TypeCol, ARow].AsString = 'CALL') then Cell.Visible := True; end;