We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Column width binding and horizontal scrolling

Hello,

I have a page with a few GridColumn.Width properties bound to properties in a view model, so that the columns are resized dynamically when the device changes orientation. 
The page constructor calls a method that updates the width for each column and sets the respective view model property, which works fine at startup. But upon device orientation change, when the same method is called, the columns are not resizing.

The page uses Fody to auto-implement INotifyPropertyChanged, which is working fine as tested with a label that gets updated when the column width update method is called.

Is there a way to force the SfDataGrid to redraw?
Also, how can I disable horizontal scrolling?

Attachment: casefiles_5326e475.zip

2 Replies

RP Rafael Pereira October 20, 2016 06:38 PM UTC

UPDATE

I had only been testing on iOS emulator, which remains the same.
On Android emulator I found the bindings to be working but SfDataGrid redrawing incorrectly from time to time, sometimes expanding the grid using horizontal scroll and other times mixing columns.

I added HorizontalOptions="FillAndExpand" and VerticalOptions="FillAndExpand" to the SfDataGrid which improved redraw on Android devices only, removing the horizontal scroll problem but sometimes a column is not drawn even though it's header is shown.

To summarize:

On Android devices work but intermittently a column is not drawn.
On Android emulators bindings work but grid redrawing has problems.
On iOS emulators bindings won't redraw the grid.
On iOS devices bindings won't redraw the grid.


AN Ashok N Syncfusion Team October 23, 2016 05:38 PM UTC

Hi Rafael,   
   
Thanks for contacting Syncfusion Support.   
   
We have analyzed your query and the reported issue was reproduced due to BindingContext was not set to BindableObject in Xamarin. A support incident has been created under your account. Please log on to our support website to check for further updates:    
     
    
Regards,    
Ashok    


Loader.
Live Chat Icon For mobile
Up arrow icon