I implemented TcxGrid with some columns. The cells of the last column in this grid contain buttons of the TcxEditButton type.
The contents of the grid are either entered by the user or loaded from a text file when creating its parent form.
I would like to hide some of these buttons based on the value in the grid. The value that determines the visibility of the buttons can be read from the grid memory dataset or directly from a hidden column in the grid.
My problem is that I could not find the correct event to check the value and set the button visibility property. I tried to use all kinds of events both in the grid table and in the column containing the buttons.
Any suggestions on how to get the button element and at the same time be able to set this when drawing the grid?
Solution: Completed using a modified version if a decision is made.
procedure TFrame_cx_Element_Inntasting_Kriterier.cxGrid_InntastingDBTVPropertiesGetProperties(
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
var AProperties: TcxCustomEditProperties);
begin
if ARecord.Values[cxGrid_ColumnWithValidatedValue.Index] = true then
AProperties := cxEditRepository1ButtonItem1.Properties
else
AProperties := cxEditRepository1Label1.Properties;
end;
source
share