Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146450 | Aug 4,2019 06:08 PM UTC | Sep 24,2019 07:44 AM UTC | Xamarin.Forms | 5 |
![]() |
Tags: SfDataGrid |
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
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.
This page will automatically be redirected to the sign-in page in 10 seconds.