将 SFDataGrid 的列绑定到 Xamarin Forms 中的 ViewModel 属性

Bind Columns of SFDataGrid to a ViewModel property in Xamarin Forms

在 UWP 中,我能够使用以下示例将 SfDataGrid 的列绑定到 ViewModel 中的 属性:https://www.syncfusion.com/kb/7811/how-to-bind-a-column-collection-from-viewmodel

但是,在 Xamarin.Forms 中对 SfDataGrid 采用相同的方法会导致异常:"System.Exception: SfDataGrid.Columns can't be null"。

Xamarin.Forms是否不支持列的 ViewModel 绑定?如果是,我有什么替代方法可以使用动态列创建网格?

提前致谢。

感谢您使用 Syncfusion 产品。

我们已经检查了您的查询“Xamarin.Forms 中的 SfDataGrid 导致异常:“System.Exception:SfDataGrid.Columns 在绑定列时不能为空”,它正在运行我们这边很好。我们已经为视图模型 属性 中的绑定列准备了示例,请从下面的 link.

中找到示例

示例 Link: BindingColumns

如果有帮助,请告诉我们。

此致

Vigneshkumar R