简体   繁体   English

详细信息视图C#

[英]Details view C#

Virtually everything i have googled describes the above perfectly in master/details view on one form. 我搜索过的几乎所有内容都在一种形式的主视图/详细视图中完美地描述了上述内容。 Is there anyway to do this on two forms? 无论如何,有两种形式吗? Basically what i want to achieve is to have my Main Form display a datagridview (with binding source, tableadapter etc) and be able to double click a record in the datagridview and have it open a new form with a details view bound to the record that was selected on the main form datagridview. 基本上我想要实现的是让我的主窗体显示一个datagridview(具有绑定源,tableadapter等),并且能够双击datagridview中的一条记录,并使其打开一个新窗体,该窗体具有绑定到该记录的详细信息视图,在主表单datagridview上被选中。

I've seen a few pseudo code examples on how to do this but would greatly appreciate a link or C# code on how to do this. 我已经看到了一些有关如何执行此操作的伪代码示例,但非常感谢您了解如何执行此操作的链接或C#代码。

Thanks in advance. 提前致谢。

您只需要提取选定的值并将其提供给新的Form(例如在其构造函数中),其余的就应该简单明了,并且与一种形式的master / detail相同

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM