【问题标题】:Bind Columns of SFDataGrid to a ViewModel property in Xamarin Forms将 SFDataGrid 的列绑定到 Xamarin Forms 中的 ViewModel 属性
【发布时间】:2018-11-12 20:05:49
【问题描述】:

在 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 绑定?如果是,我有哪些替代方法可以使用动态列创建网格?

提前致谢。

【问题讨论】:

    标签: xamarin.forms syncfusion


    【解决方案1】:

    感谢您使用 Syncfusion 产品。

    我们已使用“Xamarin.Forms 中的 SfDataGrid 导致异常:“System.Exception: SfDataGrid.Columns can't be null while binding Columns”检查了您的查询,并且在我们这边工作正常。我们已经准备好了视图模型属性中绑定列的示例,请从以下链接中找到示例。

    示例链接: BindingColumns

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

    问候

    Vigneshkumar R

    【讨论】:

    • 感谢您的样品!我已经将 Syncfusion 版本从 16.2.0.46 更新到 16.3.0.29(最新版本),就像在示例中一样,并且它工作正常。再次感谢!
    猜你喜欢
    • 1970-01-01
    • 2017-12-21
    • 1970-01-01
    • 2016-12-30
    • 2018-09-09
    • 2017-01-18
    • 2011-04-30
    • 1970-01-01
    • 2017-11-25
    相关资源
    最近更新 更多