如何在不使用数据集中相关表的情况下在 ultragrid 中获取子带?
我正在使用 linq 来拉回一个对象(即客户),该对象可能具有其他对象的集合(customer.orders)。 如果我可以将此客户列表传递到 Ultragrid 并在数据绑定上显示客户及其订单的分层视图,那就太好了。 当我尝试这样做时,我就得到了客户。 有人知道如何让它与非数据集对象一起使用吗?
I'm using linq to pull back an object (i.e. customer) that might have a collection of other objects(customer.orders). I would be nice if I can pass this list of customers to the ultragrid and a hierarchical view of customers and thier orders displayed on databind. When I try this, I just get customers. Anyone know how to get this to work with non dataset objects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
弄清楚了。 IList 集合可以工作,并且如果域对象是
IList
,则会为域对象的属性创建带区。 只需确保DisplayLayout.ViewStyle = ViewStyle.MultiBand
即可。Figured it out. IList collection works and will create bands for properties of your domain object if it is an
IList<T>
. Just make sure thatDisplayLayout.ViewStyle = ViewStyle.MultiBand
.我尝试了以下方法,但没有成功:
我从 读取这篇博客指出它必须是
List
而不是IList
才能工作,而且确实如此。I've tried the following and it didn't work:
I read from this blog that it must be
List
and notIList
in order to work, and it did.我们使用自己的自定义网格数据源,因此我们首先创建带区结构,然后按需初始化数据,处理事件
初始化数据行
初始化行集合
CellDataRequested
我们使用标签来浏览结构。
We work with our own custom datasource for grid, so we first create a structure of bands and then we initialize data OnDemand, handling events
InitializeDataRow
InitializeRowsCollection
CellDataRequested
We use Tags to navigate through the structure.