Infragistics XamDataGrid - 跟踪视图模型中选定的行
我们正在使用 Infragistics WPF v9.2 和 MVVM
我想跟踪 XamDataGrid 中当前选定的行作为视图模型中的属性,但我很难了解这是如何完成的。看起来 ActiveDataItem 属性是可行的方法,但它似乎不在 WPF v9.2 网格上。
We're using Infragistics WPF v9.2 and MVVM
I'd like to track the currently selected row from the XamDataGrid as a property in the view model but I'm struggling to see how this is done. It looks like ActiveDataItem property would be the way to go but it doesn't appear to be on the WPF v9.2 grid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ActiveDataItem 属性允许您将活动记录绑定到 VeiwModel 中的属性,但不会为您提供 XamDataGrid 的实际选择。为此,您需要使用自定义行为。以下链接提供了一些 Infragistics Silverlight 控件的示例,您可以对 WPF 中的 XamDataGrid 使用类似的方法:
http://blogs.infragistics.com/blogs/ devin_rader/archive/2011/06/01/using-behaviors-to-synchronize-selected-items-of-infragistics-silverlight-controls-to-a-viewmodel.aspx
The ActiveDataItem property would allow you to bind what is the active record to a property in your VeiwModel but wouldn't give you the actual selection of the XamDataGrid. For this you would need to use a custom behavior. The following link has examples of this for some of the Infragistics Silverlight controls and you could use a similar approach with the XamDataGrid in WPF:
http://blogs.infragistics.com/blogs/devin_rader/archive/2011/06/01/using-behaviors-to-synchronize-selected-items-of-infragistics-silverlight-controls-to-a-viewmodel.aspx
如果可以的话,请升级到10.3。
尝试让 WPF UltraGrid 与旧 9 版本的 MVVM 一起使用也有同样的痛苦。
v10.3 版本更容易,并且与 MVVM 集成得更好。
不确定升级是否需要花钱,我们有全站许可
if you can, pls upgrade to 10.3.
had the same pain of trying to get WPF UltraGrid to work with MVVM with older 9 version.
v10.3 version is much easier and better integrated with MVVM.
not sure if upgrade costs money, we had sitewide license