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
close icon

Convert/Use datatable as Source to SfDatagrid xamarin forms

Hello
I have a data table with data from sql query. (selct * from)
I know I cannot bind directly to the data table.
(Https://www.syncfusion.com/forums/125439/datatable-as-datasource-in-xamrin-forms)

But I can't convert the data table or bind to sfdatagrid.

I need a generic way, I don't know how many columns I have or the names or the data type.

would be nice to find a good way to convert / use data table to all sync fusion controls.

I have read many threads on the internet to find a way.

I've tried this:

var table = new DataTable ();
table.Load (command.ExecuteReader ());
GRID_PlanTid.AutoGenerateColumns = True;

GRID_PlanTid.ItemsSource = table;
Does not work, no errors

GRID_PlanTid.ItemsSource = table.select ()
Does not work, no errors
But when I debug, I can see all the columns and rows in the ItemsSource but the grid is empty.
What I can find then select () should return an array. List <System.Data.DataRow> list = new List <System.Data.DataRow> (table.Select ()); GRID_PlanTid.ItemsSource = list; Does not work no fault.

BR 
Jonas

5 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team August 5, 2019 11:05 AM UTC

Hi Jonas, 
 
Thank you for contacting Syncfusion support. 
 
As of now, we have don’t have the support to render DataTable in SfDataGrid Xamarin.Forms. We already considered to provide this support “DataTable binding support in SfDataGrid” and logged feature request for the same. We will implement this feature in any of our upcoming release. 
 
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.   
      
You can also communicate with us regarding the open features any time using our Feature Report page.    
  
    
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.  
  
Regards,
Subburaj Pandian V  



JO Jonas August 5, 2019 12:08 PM UTC


Hello That doesn't work, with the datatable I know. And that you intend to fix it is good. But do you have no solution so far on how to use a datatable? an already ready solution for conversion? / Jonas


BS Balasubramani Sundaram Syncfusion Team August 6, 2019 08:54 PM UTC

Hi Jonas,  
  
Thank you for the update. 
  
As we mentioned, for now we don’t have this “DataTable binding support in SfDataGrid”. We will implement this feature in any of our upcoming release. 

Also, currently we are analyzing the possibilities to achieve the same in sample level. We will update you the details on or before August 8, 2019. We appreciate your patience until then. 
  
Regards,
Subburaj Pandian V 



SP Subburaj Pandian Veluchamy Syncfusion Team August 8, 2019 01:46 PM UTC

Hi Jonas,  
  
Thank you for your patience. 
 
We have analyzed and currently the requirement to render DataTable in SfDataGrid Xamarin.Forms can’t achievable in sample level. As we mentioned earlier, we already considered to provide this support and logged feature request for the same. We will implement this feature in any of our upcoming release.  
  
You can also communicate with us regarding the open features any time using our Feature Report page.     
   
     
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.   
   
Regards,
Subburaj Pandian V   
 



FP Farjana Parveen Ayubb Syncfusion Team September 24, 2019 07:44 AM UTC

Hi Jonas, 
 
We are glad to announce that our Essential Studio 2019 Volume 3 Beta Release version 17.3.0.9 is rolled out with your requested feature “DataTable support in SfDataGrid” and is available for download under the following link. 
 
And please find the below sample for DataTable collection 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon