Skip to content
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

Rows and columns visually lose alignment when refreshing the grid and setting the Value of the horizontal scrollbar. #251

Closed
artizzq opened this issue Jan 26, 2024 · 3 comments

Comments

@artizzq
Copy link

artizzq commented Jan 26, 2024

When I scroll horizontal scrollbar to needed value using this piece of code:

                            var horizontalScroll = (((((TDG.GetVisualChildren().Cast<Visual>().ToList()[0] as Border).GetVisualChildren().Cast<Visual>().ToList()[0] as DockPanel).GetVisualChildren().Cast<Visual>().ToList()[1] as ScrollViewer).GetVisualChildren().Cast<Visual>().ToList()[0] as Grid).GetVisualChildren().Cast<Visual>().ToList()[1] as ScrollBar);
                            horizontalScroll.Value = xOffset;

and after that move vertical scroll manually I experience this problem (in picture below)
image
In total I had over 6k rows loaded to my TreeDataGrid's datasource.
All my columns have width set using new GridLength(200, GridUnitType.Pixel)
The reason I am setting the offset like this is because using basic TDG.Scroll.Offset often results in not desired position of the scroll.
The offset I am setting is based on how many columns I have and what length they have.
Visually I get desired result (I move my scroll to focused cell programmatically) but it results in visual elements' collapse.

However, it is solved if I manually move horizontal scroll from left side (first column) to right side (last column)

@artizzq
Copy link
Author

artizzq commented Feb 1, 2024

I found this issue
#6 (comment)
but it's already fixed, isn't it?
Why do I experience then?
Some of my columns have controls like Combobox as editing templates.
I wonder could it be the reason of such behaviour

@artizzq
Copy link
Author

artizzq commented Feb 7, 2024

I experience this when column widths vary, when they are equal it doesnt happen

@artizzq
Copy link
Author

artizzq commented Feb 15, 2024

Duplicate of #256

@artizzq artizzq closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant