DataGridComboBoxColumn 更改后如何更新数据库?

发布于 2024-09-06 11:22:58 字数 258 浏览 2 评论 0原文

我有一个 wpf 数据网格,它绑定到一个数据集,并且有两个组合框列,它们从主数据集获取值,并具有来自两个不同数据库的选项,一旦编辑完成,在每个其他单元格(它们是常规文本框单元格)中,数据库是通过 dataset.DataTable.RowChanged 事件更新,问题是其他两列不是同一数据表的一部分(即使它们从该数据表中获取值),因此不会调用它们时调用的相同函数值被改变。另外,我找不到在值更改时调用的事件(仅在更改之前)。

每当数据网格内的组合框发生更改时,我该怎么做才能获取事件?

I have a wpf datagrid that is bound to one dataset and has two combobox columns that take their values form the main dataset and has options from two different databases, in every other cell (which are regular textbox cells) once editing is finished the database is updated through an dataset.DataTable.RowChanged event, the problem is the two other columns aren't part of the same datatable (even though they take their value from that datatable) and so doesn't call the same function that is called when their value is changed. Also, I can't find an event that is called when the value is changed (only before it changes).

What can I do to get an event whenever a combobox inside a datagrid is changed?

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

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

发布评论

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

评论(1

宛菡 2024-09-13 11:22:58

愚蠢的我,似乎调用了更新方法(弹出一个消息框进行检查)并且算法在从组合框发送时出现问题。

Silly me, it appears that the update method is invoked (popped a MessageBox to check) and the algorithm had an issue when it was sent form the combobox.

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