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

DataGrid can not view data

Hello,

I try to bind to data on SfDataGrid like your sample project. But can not view data on the grid.
We just see empty grid screen like https://stackoverflow.com/questions/39273010/syncfusion-datagrid-in-xamarin-forms

Dlls;

PCL;
Syncfusion.Data.Portable, 
Syncfusion.GridCommon.Portable, 
Syncfusion.SfDataGrid.XForms,
Syncfusion.SfNumericTextBox.XForms

Android;
Syncfusion.Data.Portable, 
Syncfusion.GridCommon.Portable, 
Syncfusion.SfDataGrid.XForms, 
Syncfusion.SfNumericTextBox.Android, 
Syncfusion.SfNumericTextBox.XForms, 
Syncfusion.SfNumericTextBox.XForms.Android 

XAML;

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App9"
             xmlns:sync="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms"
             x:Class="App9.MainPage">

   
       
                     HorizontalOptions="FillAndExpand">
           
                             HorizontalOptions="FillAndExpand"
                             VerticalOptions="FillAndExpand"
                             ColumnSizer="Star">
           
       
   

CS;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace App9
{
    public class Person
    {
        public string Name { get; set; }
        public string Surname { get; set; }
    }
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();

            List list = new List
            {
                new Person
                {
                    Name  ="name",
                    Surname = "surname"
                }
            };
            dataGrid.ItemsSource = list;
        }

        private void Button_Clicked(object sender, EventArgs e)
        {
        }
    }
}


2 Replies

YI Yigit August 9, 2017 12:42 PM UTC

Edit XAML;


    <Grid VerticalOptions="FillAndExpand"

                     HorizontalOptions="FillAndExpand">

        <sync:SfDataGrid x:Name="dataGrid"

                             HorizontalOptions="FillAndExpand"

                             VerticalOptions="FillAndExpand"

                             ColumnSizer="Star">

        </sync:SfDataGrid>

    </Grid>



AN Ashok N Syncfusion Team August 10, 2017 05:14 AM UTC

Hi Yigit, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and you missed to refer Syncfusion.SfDataGrid.XForms.Android.dll in your android renderer project. You can achieve your requirement by adding this dll in your android project. Please refer the below UG link to get more details about assembly reference for SfDataGrid.   
 
 
Regards, 
Ashok 


Loader.
Live Chat Icon For mobile
Up arrow icon