The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I read your sample for SfDataGrid and I would like to know how create a dynamic DataModel (OrderInfos.cs). Or how create a DataGrid when the number of columns is variable.
PKPrasanth Karthikeyan Syncfusion Team December 23, 2015 09:16 AM UTC
Hi Rosemond Jordan,
Thank you for using Syncfusion Products.
We have analyzed your requirement. Currently there is no support for “Dynamic Binding” in SfDataGrid. However we have already considered this requirement as a feature and currently working on it. This feature will be available in our Volume 4, 2015 main release which is scheduled to be released by the second week of January, 2016.
Regarding your query, how create a DataGrid when the number of columns is variable? In SfDataGrid, you can add or remove columns in runtime by simply adding or removing the column in the SfDataGrid.Columns collection.The DataGrid will automatically reflect these changes in the view.
Please refer the below code example for adding columns at runtime.
PKPrasanth Karthikeyan Syncfusion Team December 24, 2015 05:18 AM UTC
Hi Rosemond Jordan,
We are glad that your issue has been fixed.
Please let us know if you require any other assistance.
Regards, Prasanth
RJRosemond JordanDecember 28, 2015 02:41 PM UTC
Hi,
It's possible to bind SfDataGrid.ItemSource with a Dictionary<string, List<string>>.Where key will be the HeaderText of the column and the values will be the bindingcontext ?
The number of item's dictionary will be variable..
PKPrasanth Karthikeyan Syncfusion Team December 29, 2015 05:34 PM UTC
Hi Rosemond Jordan,
We have analyzed your query. When you bind an IEnumerable<T> collection to the SfDataGrid, the items in the enumerator are the rows of type T and the properties of the each item of type T are the columns. But when you bind a Dictionary<string, List<string>> to a SfDataGrid, then the enumerator of the dictionary contains the generic object KeyValuePair<TKey,TValue> which contains only two properties: Key and Value. So the SfDataGrid will create only two columns Key and Value.
Instead you can use the dynamic object for which currently there is no support. However it will be available in our Volume 4, 2015 main release.
Please let us know if you have any query.
Regards, Prasanth
RJRosemond JordanDecember 30, 2015 06:58 AM UTC
Hi,
Thank you for your answer :)
PKPrasanth Karthikeyan Syncfusion Team December 31, 2015 08:58 AM UTC
Hi Rosemond,
Thanks for the update.
Please let us know if you require any further assistance on this.
Regards, Prasanth
DEDervout April 21, 2016 07:35 AM UTC
Hi,
I download the free trial for test chart and data grid.
I don't have an object to bind with data grid. The build of the grid must be dynamic because the source is not known. I just have a list of column and a list of row. You said that the dynamic binding be available on January. How it work ? I don't see anything in the documentation.
Thanks,
Camille
VPVimal Prabhu Manohkaran Syncfusion Team April 21, 2016 05:18 PM UTC
Hi Camille,
Currently there is no support for Dynamic Binding in Xamarin.Forms. It is a limitation of the Xamarin product without a JIT. Hence SfDataGrid for Xamarin.Forms too cannot support Dynamic Binding. For more details regarding this, please refer the below Bugzilla link. Bug Link: https://bugzilla.xamarin.com/show_bug.cgi?id=37071 However, SfDataGrid for Xamarin.Android supports dynamic binding and please let us know if you require any details on it. Regards, Vimal Prabhu