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.
Unfortunately, activation email could not send to your email. Please try again.

Datagrid force reload on Xamarin.iOS

Thread ID:

Created:

Updated:

Platform:

Replies:

129720 Mar 30,2017 04:59 AM Mar 31,2017 06:03 AM Xamarin.iOS 1
loading
Tags: SfDataGrid
Mohan Prasath
Asked On March 30, 2017 04:59 AM

Hi,

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 06:03 AM

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() 
{ 
    base.ViewDidLayoutSubviews(); 
    if (UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeLeft || UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeRight) 
        this.sfGrid.ColumnSizer = ColumnSizer.Star; 
    else 
        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

Regards,
Vimal Prabhu
 


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.

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.

;