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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Convert/Use datatable as Source to SfDatagrid xamarin forms

Thread ID:

Created:

Updated:

Platform:

Replies:

146450 Aug 4,2019 06:08 PM UTC Sep 24,2019 07:44 AM UTC Xamarin.Forms 5
loading
Tags: SfDataGrid
Jonas
Asked On August 4, 2019 06:08 PM UTC

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

Subburaj Pandian Veluchamy [Syncfusion]
Replied On 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  


Jonas
Replied On 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

Balasubramani Sundaram [Syncfusion]
Replied On 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 


Subburaj Pandian Veluchamy [Syncfusion]
Replied On 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   
 


Farjana Parveen Ayubb [Syncfusion]
Replied On 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 


CONFIRMATION

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

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

Live Chat Icon For mobile
Live Chat Icon