Hi,
which is the better way to show a checkbox for a TIntegerField connected to an Adapter with TTMSFNCDataGrid, having values 0= false and 1= true. Since all ways that I've tried didn't work correctly.
Hi,
which is the better way to show a checkbox for a TIntegerField connected to an Adapter with TTMSFNCDataGrid, having values 0= false and 1= true. Since all ways that I've tried didn't work correctly.
Hi,
For a TIntegerField holding 0/1 values, the reliable approach is to combine the adapter column's CheckBoxField property with the grid column's Binding true/false values. Both need to be set, and they must agree:
// 1. On the database adapter column bound to your integer field:
TMSFNCDataGridDatabaseAdapter1.Columns[idx].CheckBoxField := True;
// 2. On the matching grid column's Binding:
TMSFNCDataGrid1.Columns[idx].Binding.BooleanTrueValue := '1';
TMSFNCDataGrid1.Columns[idx].Binding.BooleanFalseValue := '0';
Both properties are also available at design time — the CheckBoxField checkbox in the adapter's Columns collection editor, and Binding.BooleanTrueValue / BooleanFalseValue on the grid column.