UI-For-UWP icon indicating copy to clipboard operation
UI-For-UWP copied to clipboard

Column Resize not working properly with more columns along with FrozenColumnCount

Open didi2391 opened this issue 6 years ago • 7 comments

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

didi2391 avatar Jan 11 '19 13:01 didi2391

@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.

APopatanasov avatar Jan 14 '19 08:01 APopatanasov

@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 - https://github.com/telerik/UI-For-UWP/issues/358

App13.zip

didi2391 avatar Jan 16 '19 06:01 didi2391

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.

APopatanasov avatar Jan 16 '19 12:01 APopatanasov

@APopatanasov - Yes solutions provided by you for https://github.com/telerik/UI-For-UWP/issues/358 & https://github.com/telerik/UI-For-UWP/issues/354 worked for me

Thanks !!!

didi2391 avatar Jan 16 '19 12:01 didi2391

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: https://github.com/telerik/UI-For-UWP/blob/46a7764138206b840dc86aa40a16633bcee6ae39/Controls/Grid/Grid.UWP/View/Columns/DataGridColumn.cs#L719

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. https://github.com/telerik/UI-For-UWP/blob/46a7764138206b840dc86aa40a16633bcee6ae39/Controls/Grid/Grid.UWP/View/Services/Updates/UpdateService.cs#L76

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.

APopatanasov avatar Jan 21 '19 08:01 APopatanasov

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!

mpettus avatar Jul 25 '19 16:07 mpettus

@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.

APopatanasov avatar Jul 26 '19 14:07 APopatanasov