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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Datagrid force reload on Xamarin.iOS

Thread ID:





129720 Mar 30,2017 08:59 AM UTC Mar 31,2017 10:03 AM UTC Xamarin.iOS 1
Tags: SfDataGrid
Mohan Prasath
Asked On March 30, 2017 08:59 AM UTC


We have an SFDataGrid and we are changing the column sizer on orientation changes. On landscape, the grid to expand to fill out the space so we are using star column sizer but in portrait we want to maintain certain widths to our columns. So we are changing the column sizer on the fly however, we can't find a way to refresh or reload the grid because there are no changes in the data. How can we achieve this? 

Vimal Prabhu Manohkaran [Syncfusion]
Replied On March 31, 2017 10:03 AM UTC

Hi Mohan,

Thanks for using Syncfusion products. Your requirement can be achieved , by checking the orientation of the device and setting the suitable ColumnSizer in the ViewLayoutSubViews( ) override of the ViewController which will be fired for the orientation changes in Xamarin.iOS. Please refer the below code snippet.
public override void ViewDidLayoutSubviews() 
    if (UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeLeft || UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeRight) 
        this.sfGrid.ColumnSizer = ColumnSizer.Star; 
        this.sfGrid.ColumnSizer = ColumnSizer.None; 
    this.sfGrid.Frame = new CGRect(0, 20, View.Frame.Width, View.Frame.Height); 

We have prepared a sample based on your requirements where we have set column sizer as none for portrait mode and star for landscape mode. Please find the sample from the below link.

Sample Link : http://www.syncfusion.com/downloads/support/forum/129720/ze/GettingStarted658956030

Vimal Prabhu


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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