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

Column Resize not working properly with more columns along with FrozenColumnCount #357

Open
didi2391 opened this issue Jan 11, 2019 · 7 comments

Comments

@didi2391
Copy link

Scenario:

I am loading RadDataGrid with more than 15 columns along with dynamic frozen columns

Since I have Frozen columns there will be some columns left out towards the right side which I have to scroll and see

Issue:

I scroll towards the right side and If I start doing resize with the last column using resize handle it automatically scrolls me to the left side without allowing me to resize and not user friendly

Also , at time I am seeing exception being raised if I repeat these action multiple times

Kindly help me on the same as I was able to reproduce this with simple example with columns more than 20

@APopatanasov
Copy link
Collaborator

@didi2391 I am not aware of the observed by you issue and using the provided description I as not able to reproduce it on my side.

Could you please, provide a sample project and a video that demonstrates your exact setup and the behavior you are observing? Without being able to reproduce the issue on my side I could not provide any further information what might be causing it.

I am looking forward to hearing from you.

@didi2391
Copy link
Author

@APopatanasov - Uploaded sample project. Kindly have a look please

If I try to resize the Column towards the right side you will see that it will automatically scroll towards the left hand side also when you long press the resize handle on the right end column for some time you can see exception getting raised (Inconsistent)

Extended the solution provided by you in this issue - #358

App13.zip

@APopatanasov
Copy link
Collaborator

Hi @didi2391 ,

Thank you for modifying the project. Using it I was able to reproduce the described by you behavior. I will need so more time to investigate it further. When I have some more detailed information to share I will let you know.

In the meantime could you please let me know if the suggestions proposed in #358 and #354 worked for you. They are marked as questions and if the suggestions worked I will close them.

Thanks again for the sample.

@didi2391
Copy link
Author

@APopatanasov - Yes solutions provided by you for #358 & #354 worked for me

Thanks !!!

@APopatanasov
Copy link
Collaborator

Hi @didi2391 ,

I have investigated the behavior you are observing and unfortunately the issue is caused by some internal logic that is part of the DataGridColumn itself and currently no workaround or solution could be suggested.

When the column is resized the Width property of the Column is changed. In the Width property changed implementation we are raising a flag for rebuilding the UI:

column.OnPropertyChange(UpdateFlags.AllButData);

Without rebuilding the UI no visual change will be observed when resizing the column. Currently, there is no other mechanism for the rebuilding and because of that applying a fix will be a tricky part.

If you are interested on working on the issue you can check the UpdateService and the how the flags are affecting them:
https://github.com/telerik/UI-For-UWP/blob/master/Controls/Grid/Grid.UWP/View/Services/Updates/UpdateService.cs
https://github.com/telerik/UI-For-UWP/blob/master/Controls/Grid/Grid.UWP/View/Services/Updates/UpdateFlags.cs

Basically when "AllButData" flag is raised (that flag contains the "AffectsScrollPosition" flag) the scroll position is changed.

grid.Model.GridView.SetScrollPosition(RadPoint.Empty, false, true);

As a fix in the width property changed basically a brand new flag should be raised that will not affect the position - this is the place from which you can start working if you are interested on applying a fix for the issue.

If you have any other questions please, let me know.

@mpettus
Copy link

mpettus commented Jul 25, 2019

I am running into this same issue. I do not have frozen columns, but if I attempt to resize, the grid scrolls all the way back to the left. This prevents the user from being able to resize a column which can only be reached by scrolling. Based on APopatanasov's answer above, I understand the issue is that a rebuild of the grid is being triggered upon column resize. However, is there any way to force the grid to scroll to the resized column after the build?

Thanks!

@APopatanasov
Copy link
Collaborator

@mpettus Based on the provided description you are observing the same. As explained in the previous reply the issue is caused by some internal logic of the control and currently no workaround could be provided.

If you are interested on working on a fix you can use the initial guidance provided above and to submit a PR. I will be glad to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants