WPF Datagrid-Master详细信息显示在与treview相同的网格中 [英] WPF Datagrid-Master details show in a same grid like treview

查看:133
本文介绍了WPF Datagrid-Master详细信息显示在与treview相同的网格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须在同一个网格中显示销售标题和saledetails。我们如何能够在WPF数据网格中实现。



我们有一个数据集有销售标题和销售明细表,我们也在销售标题和销售细节的数据集中给出了关系。如果我将saleheader datatable拖放到一个页面上,则只创建saleheader datagrid,我们无法在网格中找到销售详情。





它应该像树视图一样显示。主树应该有销售标题,如果我们向下钻取一个销售标题行,我们应该能够看到其销售详情的全部细节。



请帮助我们加入WPF数据网格。

We have to show the sale header and saledetails in the same grid.How we can able to achieve in the WPF datagrid.

We are having a dataset which is having saleheader and sale detail tables and we have given relations also in the dataset for the sale header and sale detail. If i drag and drop the saleheader datatable to a page only saleheader datagrid is created and we are not able to find the sale detail in the grid.


It should shows like a tree view. Main tree should have the sale header and if we drill down the one sale header row , we should able to see the full details of its sale details.

Please help us to acieve in the WPF datagrid .

推荐答案





我建议使用自定义包含ItemsControl的控件。你可以在我的文章中轻松看到如何做到这一点:



如何:在WPF分层DataTemplate中使用Master-Detail模式 [ ^ ]



最好的问候,



Shai
Hi,

I would recommend the use of a custom control containing ItemsControl. You can easily see how to do it in my article:

How to: Use the Master-Detail Pattern with WPF Hierarchical DataTemplate[^]

Best Regards,

Shai


这篇关于WPF Datagrid-Master详细信息显示在与treview相同的网格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆