It will get error after using unilistbox1.clear !
When I use unilistbox1.clear and add items afterwards, I'll get error after click any item and exit the listbox
Listbox - Checkbox.zip
I've found that the problem is due to the AutoPost setting of the checkbox field !! It will neglect other edited value unless I put the checkbox field to the last column !
But another problem :
When I edit the fields with roweditor, when I click the checkbox and edit the other field, only checkbox value saved and the value of the other field is not saved!
In the mean time, I've edit the unidbgrid.pas :
function TUniCustomDBGrid.XlatValue(Col: TUniBaseDBGridColumn; Fld: TField; Val: Variant): string;
...
if Col.CheckBoxField.Enabled and (not Col.CheckBoxField.BooleanFieldOnly) then
begin
S := Col.CheckBoxField.FieldValues;
sArr := ExtractBooleanValues(S);
if Length(sArr) > 0 then
begin
// changed by Allen 29/09/2020
if Val = Null then begin
Result := sArr[1];
end
else begin
B := StrToBool(Val);
if B then
Result := sArr[0]
else
Result := sArr[1];
end;
end;
end
I have a field with integer value either 0 or 1 (with checkboxfield enabled) .
When I click the checkbox directly, it has no problem. But if I edit other field with row editor opened, then I click the checkbox and confirm, error occur:
"Could not convert variant of type (Null) into type (OleStr)."
Please check and fix it ! Thanks !
When I use dbgrid roweditor and input a value 0 to a cell (decimal field with Null value initially) and click confirm , it actually won't save the zero value !
But if I first input a non-zero value and save, then I edit again and input a value 0, it will save.
Please fix it if it's a bug
I'm trying to use office viewer ocx http://www.officeocx.com/OfficeActiveX.htm
or https://www.textcontrol.com/products/activex/tx-text-control-activex/overview/ (but not actual Microsoft word)