Hi,
My FNCDataGrid has the selection mode of type gsmDisjunctRow.
I have added a checkbox column and an OnGetCellCheckBoxChange to my grid thus:
procedure TForm1.GridCellCheckBoxChange(Sender: TObject; AColumn,
ARow: Integer);
var
b:Boolean;
i:integer;
begin
b:=Grid.Booleans[AColumn, ARow];
Grid.SelectedRows[ARow]:=b;
end;
i.e. when the checkbox is selected, select the row.
If I ask for a count of Grid.SelectedRows, this works as expected.
However, I want to hide the true/false text, so I added the following OnGetCellFormatting routine:
procedure TForm1.GridGetCellFormatting(Sender: TObject;
ACell: TTMSFNCDataGridCellCoord; AData: TTMSFNCDataGridCellValue;
var AFormatting: TTMSFNCDataGridDataFormatting;
var AConvertSettings: TFormatSettings; var ACanFormat: Boolean);
begin
ACanFormat:=True;
if ACell.Column=Grid.ColumnIndexByName(SEL) then
begin
AFormatting.&Type:=gdftBoolean;
AFormatting.BooleanTrueText:=' ';
AFormatting.BooleanFalseText:=' ';
end;
end;
And this works as expected and hides the text, leaving only checkboxes.
However, when I do the .GetSelectedRows routine, the result is always 0;
Is this an error or have I done something wrong?
Thanks!