[DataGrid] Add a feature to fit multiple column's width to their content #731
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I double-click the selected multiple column headers, I want to enable the multiple column widths to be fitted at once.
The version for the single column is implemented in #546.
In this PR, I extend this to support multiple visible columns.
I restricted resizing to the visible columns because of performance limitations. On my local machine, resizing a single column of trillion rows took 800 [ms]. So, resizing millions of columns will take hundreds of hours.
In my use case, I do not want to fit all columns. The goal is to display some columns of interest on one screen and compare their contents with minimum horizontal scrolling, so with this restriction, this feature makes enough practical sense.
The behavior of this implementation is as follows:
This PR does not include a test code because I could not figure out how to implement the test code in such a case.
(ex, simulating a double click event at a specific header edge in a data-grid)
If there is any examples which I can refer, let me know and I will check them out.