Need little help with Binding...

Hello all, 

I am relatively new with UWP and experimenting SyncFusion and i am trying to bind array of List<string>

List<string> x1 = new List<string> { "One", "Two","Three", "four" };
List<string> x2 = new List<string> { "Million", "Trillion" };

ObservableCollection<List<string>> xxx = new ObservableCollection<List<string>>();
xxx.Add(x1);
xxx.Add(x2);

datagrid1.ItemsSource = xxx;

But columns displayed are "Capacity, Count and item ".    Can anyone guide me with xaml binding syntax to display above values in list<string>

 <syncfusion:SfDataGrid   x:Name="datagrid1" />


Regards





3 Replies

GT Gnanasownthari Thirugnanam Syncfusion Team January 8, 2018 06:18 AM UTC

Hi Jiya,  
  
In SfDataGrid columns are created based on the properties that are available in underlying collection which is bound to it.  In your given code snippet List<String> is data object, by default list class having the Capacity, Count and Item properties within it, so that the columns are created based upon that properties while SfDataGrid having AutoGenarateColum property as true (default value is true). This is behavior of SfDataGrid and MSDN DataGrid also works based upon this.  
  
We have prepared the sample for binding ItemsSource to SfDataGrid, you can download the same from below mentioned location:  
  
Sample location:  
 
Please refer the below UG link for more details. 
 
Regards,  
Gnanasownthari  T 



JI Jiya January 15, 2018 11:30 AM UTC

Thanks for your reply :)


GT Gnanasownthari Thirugnanam Syncfusion Team January 15, 2018 05:10 PM UTC

Hi Jiya, 
Thank you for your update, 
Please let us know if you need further assistance on this. 
Regards, 
Gnanasownthari T. 


Loader.
Up arrow icon