数据绑定复选框 [英] Databinding Checkboxes

查看:92
本文介绍了数据绑定复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单有多个复选框。用户可以选择任意数量的这些

复选框(包括无)。我的数据库中有一个表,如果选中该复选框,每个复选框将有一个

条目。如果它没有被检查过,那么该表将没有条目。


将我的复选框绑定到该表的最佳方法是什么(这是加载

到数据集中)?


非常感谢!

Mike

My form has multiple checkboxes. The user can select any number of these
checkboxes (including none). I have a table in my DB that would have one
entry per checkbox if the checkbox has been checked. If it hasn''t been
checked, then the table will not have an entry.

What is the best way to bind my checkboxes to that table (which is loaded
into a dataset)?

Thanks much!
Mike

推荐答案

你可以绑定Checked数据集数据表中每个复选框的属性

对应的数据列。

You can bind the "Checked" property of each checkbox to the
corresponding datacolumn in the Datatable of your Dataset.


哎呀,对不起,我误读了你的帖子。你的意思是说对于每个

复选框,Checked会在你的数据库表中添加一行吗?

Oops, sorry, I misread your post. did you mean to say that for each
checkbox that is Checked, a row will be added to your database table?


你不能用标准的数据绑定来做到这一点。所有控件都将绑定到单个当前记录的
。你可以使用一个网格,但它仍然很困难。

" Mike" < PC ********** @ bellsouth.net>在消息中写道

新闻:J2 ********** @ bignews3.bellsouth.net ...
You cant do that with the standard databinding. All controls will be bound
to the single current record. You can use a grid, perhaps, but it will
still be difficult.
"Mike" <pc**********@bellsouth.net> wrote in message
news:J2**********@bignews3.bellsouth.net...
我的表单有多个复选框。用户可以选择任意数量的这些复选框(包括无)。我的数据库中有一个表,如果选中了复选框,每个复选框将有一个
条目。如果没有检查,那么表格将没有条目。

将我的复选框绑定到该表格的最佳方法是什么(已加载
进入数据集)?

非常感谢!
Mike
My form has multiple checkboxes. The user can select any number of these
checkboxes (including none). I have a table in my DB that would have one
entry per checkbox if the checkbox has been checked. If it hasn''t been
checked, then the table will not have an entry.

What is the best way to bind my checkboxes to that table (which is loaded
into a dataset)?

Thanks much!
Mike



这篇关于数据绑定复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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