如何将数据传递到另一个表单进行编辑 [英] How do I pass data to another form for editing

查看:84
本文介绍了如何将数据传递到另一个表单进行编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据从数据网格视图传递到另一种形式。我想允许用户能够在第二个表单上编辑数据。我在编辑表单上有组合框,我希望它们绑定到查找数据集。我可以很容易地将数据传递到编辑表单,但只显示组合框中的当前值。当我尝试将组合框连接到各自的数据集时,原始值不显示哪个有意义。有谁知道如何在组合框中显示当前记录值,并将组合框连接到另一个数据集?

I want to pass data from a datagridview into another form. I want to allow users to be able to edit the data on this second form. I have comboboxes on the edit form and I would like them to be bound to lookup datasets. I can pass the data to the edit form easily enough but only to display the current values in the comboboxes. When I try to connect the comboboxes to their respective datasets the original value does not display which makes sense. Does anyone know how I can display the current records value in the combobox and also have the combobox connected to another dataset?

推荐答案

这是一个非常受欢迎的问题形成合作。我专门撰写了一篇文章,以通用的方式回答这些问题:回答了很多问题一次 - Windows窗体或WPF Windows之间的协作 [ ^ ]。



它涵盖 System.Windows.Forms 和WPF,还讨论了替代方案(第6节)。



-SA
This is reduced to a very popular question on form collaboration. I dedicated an article to answer them in a generic way: Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows[^].

It covers System.Windows.Forms and WPF, alternatives are also discussed (section 6).

—SA


这篇关于如何将数据传递到另一个表单进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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