Radiobuttons Databind [英] Radiobuttons Databind

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

问题描述

我已经查看并搜索过了。

Radiobuttons上的数据绑定属性有什么用?如何实际使用它?什么是好的

资源呢?我知道我可以很容易地以编程方式获取/设置我需要的信息,但是databind属性我只是不知道它是什么?b $ b了解它的价值。



Rourke Eleven

克苏鲁拯救罪人 - 以防他以后饿了!

I have looked and searched. What good is the databind property on
Radiobuttons? How does one go about actually using it? What is a good
resource on this? I understand that I can easily get/set the information I
need programmatically, but what about the databind property I just don''t
understand it''s value.



Rourke Eleven
Cthulhu saves sinners - in case he''s hungry later!

推荐答案

好的,来说明一下。创建一个包含两个字段的访问数据库。一个ID(

PK)字段和一个名为''Data''的Yes / No字段。在未选中的情况下添加

中心的三条记录。


使用服务器资源管理器,将表格拖到表格并创建数据集

DS(DS1)使用向导。


将一个复选框拖到表单(cb1)和一个按钮(btnUP)上,将以下

代码放入并运行它。一旦CB

消失,你会看到点击按钮,然后再次出现。您已将数据绑定到

控件,并使用表单的绑定上下文来移动

绑定记录。


Voilla !!


Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理MyBase.Load

DA.Fill(Ds1)

CB1.DataBindings.Add(" Checked",Ds1.Tables(0)," Data")

结束Sub


Private Sub btnUP_Click(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理btnUP.Click

Dim bm As BindingManagerBase

bm = Me.BindingContext.Item(Ds1.Tables(0))

bm.Position + = 1

结束子


-


OHM(特里伯恩斯)

。 。 。单手人。 。

" Rourke Eleven" <滚装****** @ hotmail.com>在消息中写道

新闻:uY ************** @ TK2MSFTNGP10.phx.gbl ...
OK, to illustrate. Create an access database with two fields in it. A ID (
PK ) field and a Yes/No field called ''Data''. Add Three records with the
centre on unchecked.

Using server explorer, drag the table to the form and create a DataSet
DS(DS1) using the wizard.

Drag a Checkbox onto your form (cb1) and a button (btnUP), put the following
code in and run it. You will see by clicking the button once the CB
disapears and then once again, it appears. You have bound the Data to the
control and are using the binding context of the form to move through the
bound records.

Voilla !!

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
DA.Fill(Ds1)
CB1.DataBindings.Add("Checked", Ds1.Tables(0), "Data")
End Sub

Private Sub btnUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUP.Click
Dim bm As BindingManagerBase
bm = Me.BindingContext.Item(Ds1.Tables(0))
bm.Position += 1
End Sub

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Rourke Eleven" <Ro******@hotmail.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
我查看并搜索过。 Radioobuttons上的数据绑定属性有什么用?如何实际使用它?这有什么好的资源?我知道我可以通过编程方式轻松获取/设置我需要的信息
,但是databind属性如何我不理解它的价值。



Rourke Eleven
克苏鲁拯救了罪人 - 以防他以后饿了!
I have looked and searched. What good is the databind property on
Radiobuttons? How does one go about actually using it? What is a good
resource on this? I understand that I can easily get/set the information I need programmatically, but what about the databind property I just don''t
understand it''s value.



Rourke Eleven
Cthulhu saves sinners - in case he''s hungry later!



对于所有其他人来说,这是关于VB.Net Windows Forms而不是ASP.Net


特里,


好​​我理解但是在一组

Radiobuttons和使用互斥的背景。


例如我在数据库中有字段,我希望值为0,

1,2或3(或实际上我想分配的任何值)


因此Radiobutton 1将值设置为0,依此类推。


数据绑定在这种情况下是如何工作的?


或者即使我在数据库中有一个bool并且我想使用

Radiobuttons而不是Checkbox。


我希望能够用属性设置所有这些而不是

用编程结构然后绑定。

One Handed Man(OHM - 特里伯恩斯) < news.microsoft.com>在留言中写道

新闻:好的************** @ TK2MSFTNGP12.phx.gbl ...
For all others this is regarding VB.Net Windows Forms not ASP.Net

Terry,

Ok I understand that but what about in the the context of a group of
Radiobuttons and using mutual exclusivity.

For example I have field in a database that I want to have the values of 0,
1, 2 or 3 (or actually any values I want to Assign)

So Radiobutton 1 sets the value to 0 and so on.

How does databinding work in this instance?

Or even if I had a field in a database that was bool and I wanted to use
Radiobuttons instead of a Checkbox.

I would love to be able to set all of this with properties instead of
programmatically with a decision stucture and then binding.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Ok**************@TK2MSFTNGP12.phx.gbl...
好了,来说明一下。创建一个包含两个字段的访问数据库。 ID(
PK)字段和Yes / No字段称为数据。添加带有
中心的三条记录未选中。

使用服务器资源管理器,将表格拖到表格并使用向导创建数据集
DS(DS1)。

将复选框拖到表单(cb1)和一个按钮(btnUP)上,将
后面的代码放入并运行它。一旦CB消失,您将看到单击按钮,然后再次出现。您已将数据绑定到
控件,并使用表单的绑定上下文来移动
绑定记录。

Voilla !!
Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As
System.EventArgs)处理MyBase.Load
DA.Fill(Ds1)
CB1.DataBindings.Add(" Checked" ;,Ds1.Tables(0),Data)
End Sub


私有子btnUP_Click(ByVal sender As System.Object,ByVal e As
System.EventArgs)处理btnUP.Click
Dim bm As BindingManagerBase
bm = Me.BindingContext.Item(Ds1.Tables(0))
bm.Position + = 1
End Sub

-

OHM(特里伯恩斯)
。 。 。单手人。 。

" Rourke Eleven" <滚装****** @ hotmail.com>在消息中写道
新闻:uY ************** @ TK2MSFTNGP10.phx.gbl ...
OK, to illustrate. Create an access database with two fields in it. A ID (
PK ) field and a Yes/No field called ''Data''. Add Three records with the
centre on unchecked.

Using server explorer, drag the table to the form and create a DataSet
DS(DS1) using the wizard.

Drag a Checkbox onto your form (cb1) and a button (btnUP), put the following code in and run it. You will see by clicking the button once the CB
disapears and then once again, it appears. You have bound the Data to the
control and are using the binding context of the form to move through the
bound records.

Voilla !!

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
DA.Fill(Ds1)
CB1.DataBindings.Add("Checked", Ds1.Tables(0), "Data")
End Sub

Private Sub btnUP_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUP.Click
Dim bm As BindingManagerBase
bm = Me.BindingContext.Item(Ds1.Tables(0))
bm.Position += 1
End Sub

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Rourke Eleven" <Ro******@hotmail.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
我已查看并搜索过了。 Radioobuttons上的数据绑定属性有什么用?如何实际使用它?这有什么好的资源?我知道我可以轻松获取/设置
I have looked and searched. What good is the databind property on
Radiobuttons? How does one go about actually using it? What is a good
resource on this? I understand that I can easily get/set the

信息我
需要以编程方式进行,但是databind属性如何我不理解它'的价值。


Rourke Eleven
克苏鲁拯救了罪人 - 以防他以后饿了!
need programmatically, but what about the databind property I just don''t
understand it''s value.



Rourke Eleven
Cthulhu saves sinners - in case he''s hungry later!






也许这就是你要找的。
http://msdn.microsoft.com/msdnmag/is ... s / default.aspx


Ken

--------------


" Rourke Eleven" <滚装****** @ hotmail.com>在消息中写道

新闻:uY ************** @ TK2MSFTNGP10.phx.gbl:
Hi,

Maybe this is what you are looking for.
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Ken
--------------

"Rourke Eleven" <Ro******@hotmail.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl:
我查看并搜索过。 Radioobuttons上的数据绑定属性有什么用?如何实际使用它?这有什么好的资源?我知道我可以很容易地获取/设置我需要以编程方式提供的信息,但是数据绑定属性如何我不会理解它的价值。


Rourke Eleven
克苏鲁拯救了罪人 - 以防他以后饿了!
I have looked and searched. What good is the databind property on
Radiobuttons? How does one go about actually using it? What is a good
resource on this? I understand that I can easily get/set the information
I
need programmatically, but what about the databind property I just don''t

understand it''s value.



Rourke Eleven
Cthulhu saves sinners - in case he''s hungry later!




-

外发邮件已通过无病毒验证。

由AVG Anti-Virus检查( http://www.grisoft.com)

版本:7.0.230 /病毒库:263.3.3 - 发布日期:6 / 18/2004



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.3 - Release Date: 6/18/2004


这篇关于Radiobuttons Databind的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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