Skip to content

CheckBox state propagation slow for large number of nodes #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GoranDespalatovic opened this issue Aug 8, 2018 · 1 comment
Closed
Assignees
Labels
Enhancement Open for Discussion There are several possibilites to address the issue and anyone is invited for comments.
Milestone

Comments

@GoranDespalatovic
Copy link

GoranDespalatovic commented Aug 8, 2018

Steps to reproduce :

  1. Create grid with 5 nodes each having 250000 child nodes, set all node's checkType to triStateCheckBox.
  2. Check root node, grid will select all nodes just fine
  3. Expand any of those 5 nodes, deselect checkBox. Grid takes much more time to set check states.

Suggestion :

change following methods

procedure TBaseVirtualTree.WMKeyUp(var Message: TWMKeyUp);
procedure TBaseVirtualTree.HandleMouseUp(var Message: TWMMouse; const HitInfo: THitInfo);

replace

DoCheckClick(FCheckNode, FPendingCheckState);

with

            BeginUpdate;
            try
              DoCheckClick(FCheckNode, FPendingCheckState);
            finally
              EndUpdate;
            end;

I'm not shure if it will break something because of issue #805 but it's worth considering. After code change grid selects checkboxes allmost immediately even on million child nodes.

@joachimmarder joachimmarder self-assigned this Aug 13, 2018
@joachimmarder joachimmarder added the Open for Discussion There are several possibilites to address the issue and anyone is invited for comments. label Aug 13, 2018
@joachimmarder joachimmarder added this to the V7.1 milestone Aug 13, 2018
@joachimmarder
Copy link
Contributor

The BeginUpdate() / EndUpdate() would fit better in ChangeCheckState(), which is called from DoCheckClick(). It should only be called if FCheckPropagationCount = 0. That way any code path to DoCheckClick() benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Open for Discussion There are several possibilites to address the issue and anyone is invited for comments.
Projects
None yet
Development

No branches or pull requests

2 participants