TTMSFMXGrid Header Checkboxes on Filtered entries |
Post Reply ![]() |
Author | |
Balila Cheryl Mae ![]() New Member ![]() Joined: 12 Jul 2019 Posts: 5 |
![]() ![]() ![]() ![]() Posted: 13 Aug 2019 at 12:48pm |
Hi, So I have a TTMSFMXGrid with a Header
Checkbox on [0,0]. Column[0] is a Fixed Column and is my designated
checkbox column. When i filter the grid on conditions on the other
columns, clicking the header checkbox does not check/uncheck all of the
filtered rows. I was able to work around this
by defining my own checking/unchecking procedure via
OnCellCheckBoxClick. So, I filter my grid, click on the header checkbox
(so it checks all the filtered entries). But when I reset the filters
(remove filters), the entries that satisfied the filter are checked (as
expected) but the first X rows (depending on how many rows the filtered
grid was) are also checked. Say I have 15 rows,
i filter them which results to 5 rows (real row 1, 10, 11, 12, 15). I
click the header checkbox, and they are checked. i remove the filter (no
filters in effect so it shows all rows) and now i have rows 1, 2, 3, 4,
5, 10, 11, 12 and 15 checked. I'm kinda hoping i only have 1, 10, 11,
12 and 15 checked. I need a little help as I'm not sure if I'm understanding how these (checkboxes, filters, real/display rows) work. Thanks in advance!
|
|
![]() |
|
Bruno Fierens ![]() TMS Support ![]() Joined: 11 May 2010 Posts: 8326 |
![]() ![]() ![]() ![]() |
There is at this moment not a built-in behavior that will automatically check/uncheck checkboxes in rows when a header checkbox is clicked. This should be handled at application level when desired.
I could not see there is an issue when accessing checkboxes in hidden (filtered) rows. Sample test code: begin tmsfmxgrid1.AddCheckBox(0,0,false); tmsfmxgrid1.AddCheckBox(0,1,false); tmsfmxgrid1.AddCheckBox(0,2,false); tmsfmxgrid1.AddCheckBox(0,3,false); tmsfmxgrid1.HideRow(1); tmsfmxgrid1.CheckBoxState[0,1] := true; tmsfmxgrid1.CheckBoxState[0,2] := true; tmsfmxgrid1.UnHideRow(1); end; which works here as expected.
|
|
![]() |
|
Balila Cheryl Mae ![]() New Member ![]() Joined: 12 Jul 2019 Posts: 5 |
![]() ![]() ![]() ![]() |
Thank you for your reply. However, I'm not using HideRow/Unhide row. just the built in filter of TMSFMXGrid. Except for the code to do the check-all/uncheck all in OnCellCheckBoxClick, I haven't done anything programmatically. I just did the following: 1. Filter the grid using the built in filter (which results in 5 entries: real row 1, 10, 11, 12, 15) 2. Click the Checkbox in the fixed cell [0,0] which calls OnCellCheckBoxClick to check all visible rows 3. I remove the filter on the grid by selecting (All) on the built-in filter 4. I now have rows 1, 2, 3, 4, 5, 10, 11, 12, and 15 checked. this is may OnCellCheckBoxClick code for ref:
|
|
![]() |
|
Bruno Fierens ![]() TMS Support ![]() Joined: 11 May 2010 Posts: 8326 |
![]() ![]() ![]() ![]() |
Internally, filtering uses row hiding/unhiding.
In my test code, I didn't use DisplToRealRow. Please try without.
|
|
![]() |
Post Reply ![]() |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |