I have a TFNCGrid with checkbox columns.
When a filter is applied, the checkboxes that weren't visible will not be drawn. Except the text values 'TRUE' or 'FALSE' will be displayed.
We can't reproduce this here, can you send us a sample?
Hi,
Attached you can find a test project.
It's weird because I get a "Range Check Error" when I apply the filter.
It doesn't do this in the original application. I used the exact same code as the original.
I also added a screenshot of how it appears in the original application.
TestProject.zip (99.6 KB)
Hi,
We have fixed the range check error here. The next version will address this, after fixing the range check error, we could see an issue when using checkboxes in combination with columns and will investigate what is going wrong. As a workaround, you can use the following code:
procedure TForm1.FormCreate(Sender: TObject);
var
i : Integer;
begin
Grid1.BeginUpdate;
Grid1.Clear;
Grid1.RemoveFilter;
grid1.UseColumns := False;
Grid1.RowCount := 201;
Grid1.Cells[0,0] := 'string 1';
Grid1.Cells[1,0] := 'string 2';
Grid1.Cells[2,0] := 'check ';
Grid1.Cells[3,0] := 'date';
Grid1.Cells[4,0] := 'number';
for i := 1 to 50 do
begin
Grid1.Cells[0, i] := 'AAAA';
Grid1.Cells[1, i] := 'A_A_A_A';
if Odd(i) then
Grid1.Booleans[2, i] := True
else
Grid1.Booleans[2, i] := False;
Grid1.Cells[3, i] := DateToStr(Now);
Grid1.Cells[4, i] := i.ToString;
end;
for i := 51 to 100 do
begin
Grid1.Cells[0, i] := 'BBBB';
Grid1.Cells[1, i] := 'B_B_B_B';
if Odd(i) then
Grid1.Booleans[2, i] := True
else
Grid1.Booleans[2, i] := False;
Grid1.Cells[3, i] := DateToStr(Now);
Grid1.Cells[4, i] := i.ToString;
end;
for i := 101 to 150 do
begin
Grid1.Cells[0, i] := 'CCCC';
Grid1.Cells[1, i] := 'C_C_C_C';
if Odd(i) then
Grid1.Booleans[2, i] := True
else
Grid1.Booleans[2, i] := True;
Grid1.Cells[3, i] := DateToStr(Now);
Grid1.Cells[4, i] := i.ToString;
end;
for i := 151 to 200 do
begin
Grid1.Cells[0, i] := 'DDD';
Grid1.Cells[1, i] := 'D_D_D_D';
if Odd(i) then
Grid1.Booleans[2, i] := True
else
Grid1.Booleans[2, i] := False;
Grid1.Cells[3, i] := DateToStr(Now);
Grid1.Cells[4, i] := i.ToString;
end;
Grid1.Options.Sorting.Mode := gsmNormal;
Grid1.SortData(0, sdAscending);
Grid1.EndUpdate;
end;
Hi Pieter,
Thanks for your reply.
Unfortunately disabling UseColumns removes the checkboxes all together, which defeats the purpose of course.
For now I implemented a LookupInColumn. Not quite the same, but a workable solution for the time being.
I hope you can find the culprit.
Happy bug hunting!
Did you also applied Grid1.Booleans instead of CheckBoxStates?
Hi Pieter,
Thanks for the swift response!
I overlooked that one.
This works perfect.
Thanks.
Thanks for the feedback!