可浏览属性和 Infragistics WinGrid
我正在努力解决 Infragistics WinGrid 的数据绑定行为。 可以手动定义数据模式(我正在这样做),也可以在绑定时告诉网格我不希望网格显示额外的带区或列,即使我的数据源有它们。
DisplayLayout.NewBandLoadStyle = Infragistics.Win.UltraWinGrid.NewBandLoadStyle.Hide;
DisplayLayout.NewColumnLoadStyle = Infragistics.Win.UltraWinGrid.NewColumnLoadStyle.Hide;
问题是网格总是尝试获取属性的值,即使它不在列布局中。然而,可以在域对象中使用可浏览属性:
[Browsable(false)]
并且网格将忽略该属性(它不会尝试使用属性获取器)。但我相信这是一个蹩脚的解决方法。有谁知道一种有效的方法来指示网格仅获取布局中定义的项目的值。
非常感谢
I'm struggling with the databind behaviour of the Infragistics WinGrid.
It's possible to manually define a data schema (which I'm doing) and it's also possible to tell the grid when binding that I don't want for the grid to display additional bands or columns, even if my data source has them.
DisplayLayout.NewBandLoadStyle = Infragistics.Win.UltraWinGrid.NewBandLoadStyle.Hide;
DisplayLayout.NewColumnLoadStyle = Infragistics.Win.UltraWinGrid.NewColumnLoadStyle.Hide;
The problem is that the grid ALWAYS tries to get the value of the property even if it's not in the columns layout. It's possible however use the browseable attribute in the domain object:
[Browsable(false)]
and the grid will ignore the property (it won't try to use the property getter). But I believe this is a lame workaround. Does anyone know an efficient way to instruct the grid only to get the value for the items defined in the layout.
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在grid的DisplayLayout中,有一个MaxBandDepth属性。这将限制显示的频段数量。
即,如果您有一个包含 2 个表(父子关系)的分层数据源,并且将 MaxBandDepth 设置为 1,则仅显示父表的信息。
In the DisplayLayout of the grid, there is a MaxBandDepth property. This will limit the number of bands that's shown.
I.e. if you have a heirarchical data source with 2 tables (parent to child relationship) and you set the MaxBandDepth to 1, then only the parent table's information will show.