Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

TMSFMXGrid ColumnType Checkbox and Filtering

 Post Reply Post Reply
Author
John Jorissen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 Dec 2015
Posts: 155
Post Options Post Options   Quote John Jorissen Quote  Post ReplyReply Direct Link To This Post Topic: TMSFMXGrid ColumnType Checkbox and Filtering
    Posted: 12 Sep 2019 at 3:53pm
Hi,

I have issues with the TMSFMXGrid and how checkbox cells are displayed while filtering.
In our application we want to have columns with ONLY a checkbox, without the related text.
So just a checked or unchecked checkbox per column-cell.

Initially it shows up correctly, but when I filter the data in the grid using the header-dropdown option,
it sometimes goes wrong.

I could also reproduce this with the demo application 
TMS Pack for FireMonkey Demos\Grid Feature Demos\Cell Controls

In the IDE I made the following changes to the grid:
* Options.Filtering.DropDown TRUE
* Options.Filtering.MultiColumn TRUE
* Options.Sorting.Mode gsmNormal

In the procedure TForm719.FormCreate(Sender: TObject); I made the following changes
* TMSFMXGrid1.Columns[2].ColumnType := ctCheckBox; // AddCheckBoxColumn(2);

Running the demo displays the grid as wanted.
When I Filter Column 5 using the dropdown button (I choose value 4)
you can see in column 2 that the top half still shows the checkboxes, while the bottom half shows the texts.

This doesn't seem to be correct.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3302
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 2019 at 2:53pm
Hi,

If you don't want text, then you should not add text. The demo that you have manipulated, adds text. So 
Please either remove the LoadFromCSV method, add the text manually, or exclude the text via events:

procedure TForm1.TMSFMXGrid1GetCellData(Sender: TObject; ACol, ARow: Integer;
  var CellString: string);
begin
  if ACol = 2 then
    CellString := '';
end;
Back to Top
John Jorissen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 Dec 2015
Posts: 155
Post Options Post Options   Quote John Jorissen Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 2019 at 3:06pm
Hi Pieter,
Thanks for your reply.

The checkbox will be (un)checked based on the TRUE/FALSE value.
And I know I could manipulate displayed data using the events.

The real problems is that you would expect the grid always to display checkboxes (with or without text).
In my example to top half of the grid shows a checkbox in the 1st column, the bottom half displays text INSTEAD of a checkbox.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3302
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 2019 at 3:08pm
We'll investigate the issue with text still displaying, but I supposed this is because there is a mismatch combination of text and checkbox column. You need to either use a column, or use text. Only AddCheckBoxColumn can work together with text.
Back to Top
John Jorissen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 Dec 2015
Posts: 155
Post Options Post Options   Quote John Jorissen Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 2019 at 4:24pm
Actually in our program, we don't have text.

We just define the column as a checkbox column by using
Column := Columns.Add; 
Column.ColumnType := ctCheckBox;

And we set the checkboxes with
CheckBoxState[Col, Row] := True/False;

This is a display-error after the filtering which shows up as the text TRUE of FALSE and not showing the checkbox any more.

Besides that also other display problems occur.
We use OnGetCellAppearance for coloring the grid.
These colors are "lost" as well.
Same with e.g. the colors of the grid bands.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3302
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 2019 at 4:25pm
Can you list up known issues and steps to reproduce so we can further investigate?
Back to Top
John Jorissen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 Dec 2015
Posts: 155
Post Options Post Options   Quote John Jorissen Quote  Post ReplyReply Direct Link To This Post Posted: 17 Sep 2019 at 12:13pm
I will send a mail with a screenshot and the code I used in the demo program.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down