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

Binding to datapager data doesn't display

Hi I have followed the examples here to try and create paging in my datagrid. The paging controls show and I have bound to the pager in the code behind but my datagrid shows nothing. Any help appreciated. (PlayerList is an ObservableCollection)

public MainView()
            this.PlayerDataGrid.ItemsSource = sfDataPager.PagedSource;

        <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
            <Grid HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand">
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />

            <sfpager:SfDataPager x:Name ="sfDataPager"
                           HeightRequest ="50"
                           Source="{Binding PlayerList}">
                <datagrid:SfDataGrid x:Name="PlayerDataGrid"
                                     AllowPullToRefresh ="True"
                                    PullToRefreshCommand="{Binding RefreshCommand}"
                                     IsBusy="{Binding IsBusy}"
                    <datagrid:SfDataGrid.Columns x:TypeArguments="syncfusion:Columns">
                        <datagrid:GridTextColumn HeaderText="Name" 
                                             MappingName="FirstName" />
                        <datagrid:GridTextColumn HeaderText="Surname"
                                             MappingName="LastName" />
                        <datagrid:GridTextColumn HeaderText="Guardian" 
                                             MappingName="ParentFName" />
                        <datagrid:GridTextColumn HeaderText="Phone"
                                             MappingName="PhoneNum" />
                        <datagrid:GridTextColumn HeaderText="Team"

                        <datagrid:SortColumnDescription ColumnName="FirstName" 
                                          SortDirection="Ascending" />
                        <datagrid:SortColumnDescription ColumnName="LastName" 
                                          SortDirection="Ascending" />
                        <datagrid:SortColumnDescription ColumnName="PlayersTeam.TeamName" 
                                          SortDirection="Ascending" />


1 Reply

DS Divakar Subramaniam Syncfusion Team December 12, 2016 06:28 AM UTC

Hi Ciaran, 
Thanks for contacting Syncfusion Support. 
We have checked your query and we were not able to reproduce the reported issue on our side. We have prepared a simple sample using SfDataPager and SfDataGrid controls and also applied the code you have provided in your update and the SfDatagrid was loading fine with data. 
We have attached our sample for your sample and you can download the same from the below link. 
Please ensure that in order to load the SfDataGid in Forms.iOS platform, you need to initialize the SfDataGrid in Forms.iOS project as like in below code snippet. 
// In AppDelegate.cs 
using Syncfusion.SfDataGrid.XForms.iOS; 
public override bool FinishedLaunching(UIApplication app, NSDictionary options) 
    LoadApplication(new App()); 
    return base.FinishedLaunching(app, options); 

Live Chat Icon For mobile
Up arrow icon