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

Screen shows blank when the itemsource is binded in the xaml .

Thread ID:





132822 Sep 22,2017 07:14 PM UTC Sep 25,2017 05:05 AM UTC Xamarin.Forms 1
Tags: SfDataGrid
Nandini Nadig
Asked On September 22, 2017 07:14 PM UTC


 Please find the project file attached. Could you please help me on this? I tried the example of the website. But when I say 

Itemsource = new ... In the code behind it works. Why does not it work from xaml?


Attachment: GridExample_953b5ca3.zip

Ashok N [Syncfusion]
Replied On September 25, 2017 05:05 AM UTC

Hi Nandini, 
Thanks for contacting Syncfusion support.  
We have checked your codes and we noticed that there is a mismatch in the namespace of the collection class which you are trying to bind as ItemsSource. You used OrderInfoRepository is a BindingContext instead of ViewModel class and mistakenly used OrderInfoCollection instead of using OrdersInfo which is the actual name of the collection. Please refer the below code snippet and change the ItemsSource to {Binding OrdersInfo} to rectify the same. 
<?xml version="1.0" encoding="utf-8" ?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:syncfusion="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms" > 
        <local:ViewModel x:Name="viewModel" /> 
            <syncfusion:SfDataGrid x:Name="dataGrid" 
                               ItemsSource="{Binding OrdersInfo}"> 
private ObservableCollection<OrderInfo> ordersInfo; 
public ObservableCollection<OrderInfo> OrdersInfo 
    get { return ordersInfo; } 
    set { this.ordersInfo = value; RaisePropertyChanged("OrdersInfo"); } 


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

or the page will be automatically redirected to 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