详情查看C#
事实上,我在谷歌上搜索到的所有内容都在一种形式的主/详细信息视图中完美地描述了上述内容。有没有办法在两种形式上做到这一点?基本上我想要实现的是让我的主窗体显示一个 datagridview (带有绑定源、表适配器等),并能够双击 datagridview 中的记录并让它打开一个新窗体,其中详细信息视图绑定到该记录在主窗体 datagridview 上选择。
我已经看到了一些关于如何执行此操作的伪代码示例,但非常感谢有关如何执行此操作的链接或 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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需提取选定的值并将其提供给您的新表单(例如在其构造函数中) - 其余部分应该直接进行,与一种表单上的主/详细信息中的相同
you just have to extract the selected value and have to give it to your new Form (for example in it's constructor) - the rest should be straight forward and the same as in master/detail on one form