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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Column width binding and horizontal scrolling

Thread ID:

Created:

Updated:

Platform:

Replies:

127008 Oct 20,2016 05:38 PM UTC Oct 23,2016 05:38 PM UTC Xamarin.Forms 2
loading
Tags: SfDataGrid
Rafael Pereira
Asked On October 20, 2016 05:38 PM UTC

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

Rafael Pereira
Replied On 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.

Ashok N [Syncfusion]
Replied On 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    


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;