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
toRestoreSelection works unexpected in case multiple items have the same name #981
Comments
Proposed change: Introduce new public property RestoreSelectionUniqueColumn. The getter will return MainColumn unless the developer assigned another value. |
Haven't looked at the code, but it sounds like the selected strings are stored for comparison. I guess you can never make sure that the values in a column are unique. |
That would solve the issue comprehensively, but due to virtual nature of the control, this UID needs to be provided by the application, so that it stays the same after a refill of the control. And the ID needs to be stored with every node and consumes memory, but would be useful only in corner cases. Therefore, the idea to use already existing information and allow the developer to mark one column as the one with unique information, instead of using a fix column index 0. |
@joachimmarder : 2 Lines of code in VirtualTrees.pas need to be adjusted in order to make this work as expected:
|
Currently the code behind the
toRestoreSelection
uses the text of column 0 to restore the selection after a refill of the control.In case multiple items with the same text exists, this produces unexpected results, e.g. more nodes are selected than it was orignally the case.
The text was updated successfully, but these errors were encountered: