如何将绑定到集合类的列呈现为 Infragistics UltraWinGrid 中的子行?

发布于 2024-08-09 16:02:43 字数 776 浏览 15 评论 0原文

我有一个绑定到 DataSet 的 UltraWinGrid,其中几列本身就是集合类类型,如下所示:-

<代码>[名称] - 字符串

[描述] - 字符串

[组件] = 列表<组件>

[级别] = 列表<级别>

目前,最后两个字段在绑定到数据网格时是隐藏列,用于确定绑定表单上其他两个数据网格的数据。

为了提供屏幕的打印视图,我需要将其他两个数据网格设置为第一个数据网格行的子级,如下所示

  • :项目1 描述
    • 组件
      • 组件 1 名称 |组件 1 值
      • 组件 2 名称 |组件2值
    • 级别
      • 一级名称 | 1 级值
      • 二级名称 | 2级值
  • 项目 2 名称 |项目2 说明
    • 组件
      • 组件 1 名称 |组件 1 值
      • 组件 2 名称 |组件2值
    • 级别
      • 一级名称 | 1 级值
      • 二级名称 | 2级值

我怀疑我需要创建一个新的合并数据集,可能需要使用 DataRelations,但我正在努力弄清楚如何正确地取出数据。

有人能引导我走向正确的方向吗?

I have a UltraWinGrid that is bound to a DataSet, in which a couple of columns are themselves of a collection class type, like so :-

[Name] - string

[Description] - string

[Components] = List<Component>

[Levels] = List<Level>

Currently, these last two fields are hidden columns when bound to the datagrid and used to determine the data to bind two other datagrids on the form.

In order to provide a print view of the screen, I need to make the other two datagrids children of the first datagrid's rows, like so :-

  • Item1 Name | Item1 Description
    • Components
      • Component1 Name | Component1 Value
      • Component2 Name | Component2 Value
    • Levels
      • Level1 Name | Level1 Value
      • Level2 Name | Level2 Value
  • Item2 Name | Item2 Description
    • Components
      • Component1 Name | Component1 Value
      • Component2 Name | Component2 Value
    • Levels
      • Level1 Name | Level1 Value
      • Level2 Name | Level2 Value

I suspect I need to make a new merged dataset, possibly with DataRelations, but I'm struggling to figure out how to bring the data out correctly.

Can anyone steer me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

牵你手 2024-08-16 16:02:43

好吧,我想我已经解决了这个问题(尽管需要一些整理)。诀窍是将“父”数据拉出到列表中(当前有一个丑陋的 foreach 循环)并将网格绑定到该列表,确保网格设置为 MultiBand。

由于这两个子集合也是 List 集合,因此它会自动处理它们。

这个答案,我将投票以表达我的赞赏。

Ok, think I've solved this one (albeit needs a little tidying up). The trick is to pull the "parent" data out into a List (currently with an ugly foreach loop) and bind the grid to that, ensuring you're grid is set to MultiBand.

Since the two child collections are also List collections it handles them automagically.

Discovered the solution with the help of this answer, which I shall vote up to show my appreciation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文