[C#]
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (this.screenWidth != width && dataGrid.Width>0 || this.screenHeight != height && dataGrid.Height>0)
{
// Update page size when device orientation is changed
this.screenWidth = width;
this.screenHeight = height;
dataPager.PageSize= this.SetPageSize();
dataPager.ForceLayout();
}
}
private int SetPageSize()
{
return (int)((dataGrid.Height - (dataGrid.GetRowHeight(dataGrid.GetHeaderIndex()) - dataGrid.Padding.Top - dataGrid.Padding.Bottom)) / dataGrid.RowHeight);
} |
using Syncfusion.SfDataGrid.XForms; using Syncfusion.SfDataGrid.XForms.DataPager; |
<xForms:SfDataGrid x:Name="dataGrid" Grid.Row="1" Grid.Column="0" AutoGeneratingColumn="dataGrid_AutoGeneratingColumn" AutoGenerateColumns="true" ColumnSizer="Auto" NavigationMode="Cell" SelectionMode="Single" VerticalOverScrollMode="None"> |
Hi Andre,
Thanks for your update.
We have checked your query and we have prepared the sample with Xamarin.Forms 3.4, Syncfusion.Xamarin.SfDataGrid 16.4.0.42 and .net standard 2.0 and tested the sample in VS15.9.5. But we are not able to reproduce the reported “GetRowHeight is not found as extension method for SfDataGrid” issue. We have attached the sample for your reference and you can download the same from the below link. If still the issue reproduced from your side, please modify the attached sample and revert us. It will help us to provide the better solution.
Sample Link: http://www.syncfusion.com/downloads/support/forum/142120/ze/DataGridDemo_Pager1285937703
Regards,Jagadeesan
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (this.screenWidth != width && dataGrid.Width > 0 || this.screenHeight != height && dataGrid.Height > 0)
{
this.screenWidth = width;
this.screenHeight = height;
dataPager.PageSize = this.SetPageSize();
dataPager.ForceLayout();
}
}
private int SetPageSize()
{
return (int)((dataGrid.Height - (dataGrid.GetRowHeight(dataGrid.GetHeaderIndex()) - dataGrid.Padding.Top - dataGrid.Padding.Bottom)- dataPager.Height) / dataGrid.RowHeight);
}
|
dataGrid.GetRowHeight(dataGrid.GetHeaderIndex()) |
(int)Math.Round((dataGrid.Height - (dataGrid.GetRowHeight(dataGrid.GetHeaderIndex()) - dataGrid.Padding.Top - dataGrid.Padding.Bottom) - dataPager.Height) / dataGrid.RowHeight); |
André