I have set up a blank project with a TMSFNCDatagrid and added the following routines:
procedure TForm2.TMSFNCDataGrid1GetCellClass(Sender: TObject; AColumn,
ARow: Integer; var ACellClass: TTMSFNCDataGridCellClass);
begin
if AColumn=0 then
ACellClass:=TTMSFNCDataGridCheckBoxCell;
end;
procedure TForm2.WebFormShow(Sender: TObject);
begin
TMSFNCDataGrid1.Columns.Add;
TMSFNCDataGrid1.AddCheckBoxColumn(TMSFNCDataGrid1.ColumnCount-1);
end;
I believe that I did a complete uninstall/reinstall of TMS after a Smart Setup update didn’t work as expected.
I can’t think of anything else, I’m afraid.
Here is the project that I have previously compiled and currently have working:
The previously compiled one works as expected, but when I run the code now, the checkboxes don’t check and if I click off the checkbox some strange exception occurs.
Just for the sake of completeness, below is the code for the above.
procedure TForm2.TMSFNCDataGrid1BeforeDrawCell(Sender: TObject;
AGraphics: TTMSFNCGraphics; ACell: TTMSFNCDataGridCell;
var ACanDraw: Boolean);
begin
if ACell.Column=TMSFNCDataGrid1.ColumnCount-1 then
ACell.DrawElements:=ACell.DrawElements-[gcdText];
end;
procedure TForm2.TMSFNCDataGrid1CellCheckBoxChange(Sender: TObject; AColumn,
ARow: Integer);
var
b:Boolean;
begin
b:=TMSFNCDataGrid1.Booleans[AColumn, ARow];
TMSFNCDataGrid1.SelectedRows[ARow]:=b;
end;
procedure TForm2.WebFormShow(Sender: TObject);
var
col:TTMSFNCDataGridColumn;
i:integer;
begin
col:=TMSFNCDataGrid1.Columns.Add;
col.ReadOnly:=True;
col.Editor:=getNone;
col.Name:='';
col.DisplayName:='Select';
col.Header:='Select';
TMSFNCDataGrid1.AddDataCheckBoxColumn(TMSFNCDataGrid1.Columns.Count-1);
TMSFNCDataGrid1.AddCheckBox(col.Index, 0);
for i:=0 to TMSFNCDataGrid1.RowCount-1 do
begin
TMSFNCDataGrid1.Cells[col.index, i]:=False;
TMSFNCDataGrid1.ControlAligns[col.index, i]:=gcaClient;
end;
end;
The method I used previously in my project was option 3. Now I can’t select the checkbox and if I click in the whitespace in the cell, I get an exception.
None of these columns allows me to select the checkbox.
I cannot see the issue that checkboxes cannot be checked here
I recommend you make sure to use TMS WEB Core v3.0 (available on the "My Products" page) and the latest version of TMS FNC Core / TMS FNC UI Pack.
I’ve updated to TMS Web Core v3.0 and that allows the checkboxes to be displayed again
Unfortunately, I do have an issue still.
As you can see in the above, if I click in the white space of the column, sometimes the boolean text bleeds through, and then even sometimes I get a strange exception.
In the above, this took some effort to reproduce (I was clicking very rapidly) but in my project, this happens pretty much without fail when pressing the whitespace.
Unfortunately it’s taking longer that anticipated due to the complex nature of this issue. Rest assured, we are working on it and will report back as soon as possible.