How do you get child bands in ultragrid without using related tables in a dataset?

自古美人都是妖i 提交于 2019-12-10 13:57:04

问题


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?


回答1:


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.




回答2:


I've tried the following and it didn't work:

DisplayLayout.ViewStyle = ViewStyle.MultiBand

I read from this blog that it must be List and not IList in order to work, and it did.




回答3:


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.



来源:https://stackoverflow.com/questions/266507/how-do-you-get-child-bands-in-ultragrid-without-using-related-tables-in-a-datase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!