Radiobuttons Databind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rourke Eleven

    Radiobuttons Databind

    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 programmaticall y, 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!


  • One Handed Man \( OHM - Terry Burns \)

    #2
    Re: Radiobuttons Databind

    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(ByVa l sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load
    DA.Fill(Ds1)
    CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
    End Sub

    Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e As
    System.EventArg s) Handles btnUP.Click
    Dim bm As BindingManagerB ase
    bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
    bm.Position += 1
    End Sub

    --

    OHM ( Terry Burns )
    . . . One-Handed-Man . . .


    "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
    news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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[/color]
    I[color=blue]
    > need programmaticall y, 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!
    >
    >[/color]


    Comment

    • Rourke Eleven

      #3
      Re: Radiobuttons Databind

      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
      programmaticall y with a decision stucture and then binding.


      "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
      news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...[color=blue]
      > 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[/color]
      following[color=blue]
      > 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(ByVa l sender As System.Object, ByVal e As
      > System.EventArg s) Handles MyBase.Load
      > DA.Fill(Ds1)
      > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
      > End Sub
      >
      > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e As
      > System.EventArg s) Handles btnUP.Click
      > Dim bm As BindingManagerB ase
      > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
      > bm.Position += 1
      > End Sub
      >
      > --
      >
      > OHM ( Terry Burns )
      > . . . One-Handed-Man . . .
      >
      >
      > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
      > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...[color=green]
      > > 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[/color][/color]
      information[color=blue]
      > I[color=green]
      > > need programmaticall y, 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!
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ken Tucker [MVP]

        #4
        Re: Radiobuttons Databind

        Hi,

        Maybe this is what you are looking for.
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


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

        "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
        news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl:[color=blue]
        > 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 programmaticall y, 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!
        >[/color]

        --
        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


        Comment

        • One Handed Man \( OHM - Terry Burns \)

          #5
          Re: Radiobuttons Databind

          OK, that was not clear in your OP. Ken posted link but I have not checked
          that out, if you are still having difficulties by tomorrow, I'll try and
          help

          --

          OHM ( Terry Burns )
          . . . One-Handed-Man . . .


          "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
          news:%23PII9jVW EHA.2928@tk2msf tngp13.phx.gbl. ..[color=blue]
          > 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[/color]
          0,[color=blue]
          > 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
          > programmaticall y with a decision stucture and then binding.
          >
          >
          > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
          message[color=blue]
          > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...[color=green]
          > > OK, to illustrate. Create an access database with two fields in it. A ID[/color][/color]
          ([color=blue][color=green]
          > > PK ) field and a Yes/No field called 'Data'. Add Three records with[/color][/color]
          the[color=blue][color=green]
          > > 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[/color]
          > following[color=green]
          > > 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[/color][/color]
          the[color=blue][color=green]
          > > control and are using the binding context of the form to move through[/color][/color]
          the[color=blue][color=green]
          > > bound records.
          > >
          > > Voilla !!
          > >
          > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
          > > System.EventArg s) Handles MyBase.Load
          > > DA.Fill(Ds1)
          > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
          > > End Sub
          > >
          > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e As
          > > System.EventArg s) Handles btnUP.Click
          > > Dim bm As BindingManagerB ase
          > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
          > > bm.Position += 1
          > > End Sub
          > >
          > > --
          > >
          > > OHM ( Terry Burns )
          > > . . . One-Handed-Man . . .
          > >
          > >
          > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
          > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...[color=darkred]
          > > > I have looked and searched. What good is the databind property on
          > > > Radiobuttons? How does one go about actually using it? What is a[/color][/color][/color]
          good[color=blue][color=green][color=darkred]
          > > > resource on this? I understand that I can easily get/set the[/color][/color]
          > information[color=green]
          > > I[color=darkred]
          > > > need programmaticall y, but what about the databind property I just[/color][/color][/color]
          don't[color=blue][color=green][color=darkred]
          > > > understand it's value.
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > > > Rourke Eleven
          > > > Cthulhu saves sinners - in case he's hungry later!
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Rourke Eleven

            #6
            Re: Radiobuttons Databind

            Ken's answer is great and I think I will use it, but it still doesn't answer
            1 of my questions. Why have databinding on Radiobuttons? What is its use?

            I can't think of a time that I would have just a single radiobutton on a
            form. As the Article that Ken sent points out Microsoft needs to think
            about building in a control that does what Duncan Mackenzie does in his user
            control. Make a Radiobutton ListControl with a simple interface like that
            of a Web Combobox which you can input your own Members with a Text/values in
            a listcontrol container or you can databind.

            "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
            news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...[color=blue]
            > OK, that was not clear in your OP. Ken posted link but I have not checked
            > that out, if you are still having difficulties by tomorrow, I'll try and
            > help
            >
            > --
            >
            > OHM ( Terry Burns )
            > . . . One-Handed-Man . . .
            >
            >
            > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
            > news:%23PII9jVW EHA.2928@tk2msf tngp13.phx.gbl. ..[color=green]
            > > 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[/color]
            > 0,[color=green]
            > > 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
            > > programmaticall y with a decision stucture and then binding.
            > >
            > >
            > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
            > message[color=green]
            > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...[color=darkred]
            > > > OK, to illustrate. Create an access database with two fields in it. A[/color][/color][/color]
            ID[color=blue]
            > ([color=green][color=darkred]
            > > > PK ) field and a Yes/No field called 'Data'. Add Three records with[/color][/color]
            > the[color=green][color=darkred]
            > > > centre on unchecked.
            > > >
            > > > Using server explorer, drag the table to the form and create a[/color][/color][/color]
            DataSet[color=blue][color=green][color=darkred]
            > > > DS(DS1) using the wizard.
            > > >
            > > > Drag a Checkbox onto your form (cb1) and a button (btnUP), put the[/color]
            > > following[color=darkred]
            > > > 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[/color][/color]
            > the[color=green][color=darkred]
            > > > control and are using the binding context of the form to move through[/color][/color]
            > the[color=green][color=darkred]
            > > > bound records.
            > > >
            > > > Voilla !!
            > > >
            > > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
            > > > System.EventArg s) Handles MyBase.Load
            > > > DA.Fill(Ds1)
            > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
            > > > End Sub
            > > >
            > > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e As
            > > > System.EventArg s) Handles btnUP.Click
            > > > Dim bm As BindingManagerB ase
            > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
            > > > bm.Position += 1
            > > > End Sub
            > > >
            > > > --
            > > >
            > > > OHM ( Terry Burns )
            > > > . . . One-Handed-Man . . .
            > > >
            > > >
            > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
            > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
            > > > > I have looked and searched. What good is the databind property on
            > > > > Radiobuttons? How does one go about actually using it? What is a[/color][/color]
            > good[color=green][color=darkred]
            > > > > resource on this? I understand that I can easily get/set the[/color]
            > > information[color=darkred]
            > > > I
            > > > > need programmaticall y, but what about the databind property I just[/color][/color]
            > don't[color=green][color=darkred]
            > > > > understand it's value.
            > > > >
            > > > >
            > > > >
            > > > >
            > > > >
            > > > >
            > > > >
            > > > > Rourke Eleven
            > > > > Cthulhu saves sinners - in case he's hungry later!
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Rourke Eleven

              #7
              Re: Radiobuttons Databind

              This is great. It will work for what I am doing. Makes me wonder why
              Microsloth didn't do it first.

              Thanks Ken!!!


              "Ken Tucker [MVP]" <vb2ae@bellsout h.net> wrote in message
              news:OWV0qoVWEH A.2196@TK2MSFTN GP10.phx.gbl...[color=blue]
              > Hi,
              >
              > Maybe this is what you are looking for.
              > http://msdn.microsoft.com/msdnmag/is...s/default.aspx
              >
              > Ken
              > --------------
              >
              > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
              > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl:[color=green]
              > > 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[/color][/color]
              information[color=blue][color=green]
              > > I
              > > need programmaticall y, 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!
              > >[/color]
              >
              > --
              > 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
              >
              >[/color]


              Comment

              • One Handed Man \( OHM - Terry Burns \)

                #8
                Re: Radiobuttons Databind

                No of course you would not have a single Radio button on a form, however, I
                personally have used bound radio buttons on a form along with other
                controls. I wrote a helpdesk system and some of the selections were bound to
                Radio buttons and checkboxes.

                It's also possible to display checkboxes on a datagrid bound in the same way
                with a bit of binding magic and a dice of Controls. But that gets a little
                complex.

                In asnwer to you question ( and im not Microsoft ) ; why not ?

                --

                OHM ( Terry Burns )
                . . . One-Handed-Man . . .


                "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                news:%2358byLWW EHA.2176@TK2MSF TNGP11.phx.gbl. ..[color=blue]
                > Ken's answer is great and I think I will use it, but it still doesn't[/color]
                answer[color=blue]
                > 1 of my questions. Why have databinding on Radiobuttons? What is its[/color]
                use?[color=blue]
                >
                > I can't think of a time that I would have just a single radiobutton on a
                > form. As the Article that Ken sent points out Microsoft needs to think
                > about building in a control that does what Duncan Mackenzie does in his[/color]
                user[color=blue]
                > control. Make a Radiobutton ListControl with a simple interface like that
                > of a Web Combobox which you can input your own Members with a Text/values[/color]
                in[color=blue]
                > a listcontrol container or you can databind.
                >
                > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                message[color=blue]
                > news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...[color=green]
                > > OK, that was not clear in your OP. Ken posted link but I have not[/color][/color]
                checked[color=blue][color=green]
                > > that out, if you are still having difficulties by tomorrow, I'll try and
                > > help
                > >
                > > --
                > >
                > > OHM ( Terry Burns )
                > > . . . One-Handed-Man . . .
                > >
                > >
                > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                > > news:%23PII9jVW EHA.2928@tk2msf tngp13.phx.gbl. ..[color=darkred]
                > > > 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[/color][/color][/color]
                of[color=blue][color=green]
                > > 0,[color=darkred]
                > > > 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[/color][/color][/color]
                use[color=blue][color=green][color=darkred]
                > > > Radiobuttons instead of a Checkbox.
                > > >
                > > > I would love to be able to set all of this with properties instead of
                > > > programmaticall y with a decision stucture and then binding.
                > > >
                > > >
                > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                > > message[color=darkred]
                > > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...
                > > > > OK, to illustrate. Create an access database with two fields in it.[/color][/color][/color]
                A[color=blue]
                > ID[color=green]
                > > ([color=darkred]
                > > > > PK ) field and a Yes/No field called 'Data'. Add Three records[/color][/color][/color]
                with[color=blue][color=green]
                > > the[color=darkred]
                > > > > centre on unchecked.
                > > > >
                > > > > Using server explorer, drag the table to the form and create a[/color][/color]
                > DataSet[color=green][color=darkred]
                > > > > 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[/color][/color][/color]
                to[color=blue][color=green]
                > > the[color=darkred]
                > > > > control and are using the binding context of the form to move[/color][/color][/color]
                through[color=blue][color=green]
                > > the[color=darkred]
                > > > > bound records.
                > > > >
                > > > > Voilla !!
                > > > >
                > > > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
                > > > > System.EventArg s) Handles MyBase.Load
                > > > > DA.Fill(Ds1)
                > > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
                > > > > End Sub
                > > > >
                > > > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e[/color][/color][/color]
                As[color=blue][color=green][color=darkred]
                > > > > System.EventArg s) Handles btnUP.Click
                > > > > Dim bm As BindingManagerB ase
                > > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
                > > > > bm.Position += 1
                > > > > End Sub
                > > > >
                > > > > --
                > > > >
                > > > > OHM ( Terry Burns )
                > > > > . . . One-Handed-Man . . .
                > > > >
                > > > >
                > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                > > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
                > > > > > I have looked and searched. What good is the databind property on
                > > > > > Radiobuttons? How does one go about actually using it? What is a[/color]
                > > good[color=darkred]
                > > > > > resource on this? I understand that I can easily get/set the
                > > > information
                > > > > I
                > > > > > need programmaticall y, but what about the databind property I just[/color]
                > > don't[color=darkred]
                > > > > > understand it's value.
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > > Rourke Eleven
                > > > > > Cthulhu saves sinners - in case he's hungry later!
                > > > > >
                > > > > >
                > > > >
                > > > >
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Rourke Eleven

                  #9
                  Re: Radiobuttons Databind

                  I am not just trying to argue, but what would you bind to the radiobutton?
                  The Text property? Help me here I am a little lost. Normally I would want
                  to bind data so that I could effect a change to the backend data or display
                  the data.

                  "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
                  news:OYB12ZbWEH A.3120@TK2MSFTN GP12.phx.gbl...[color=blue]
                  > No of course you would not have a single Radio button on a form, however,[/color]
                  I[color=blue]
                  > personally have used bound radio buttons on a form along with other
                  > controls. I wrote a helpdesk system and some of the selections were bound[/color]
                  to[color=blue]
                  > Radio buttons and checkboxes.
                  >
                  > It's also possible to display checkboxes on a datagrid bound in the same[/color]
                  way[color=blue]
                  > with a bit of binding magic and a dice of Controls. But that gets a little
                  > complex.
                  >
                  > In asnwer to you question ( and im not Microsoft ) ; why not ?
                  >
                  > --
                  >
                  > OHM ( Terry Burns )
                  > . . . One-Handed-Man . . .
                  >
                  >
                  > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                  > news:%2358byLWW EHA.2176@TK2MSF TNGP11.phx.gbl. ..[color=green]
                  > > Ken's answer is great and I think I will use it, but it still doesn't[/color]
                  > answer[color=green]
                  > > 1 of my questions. Why have databinding on Radiobuttons? What is its[/color]
                  > use?[color=green]
                  > >
                  > > I can't think of a time that I would have just a single radiobutton on a
                  > > form. As the Article that Ken sent points out Microsoft needs to think
                  > > about building in a control that does what Duncan Mackenzie does in his[/color]
                  > user[color=green]
                  > > control. Make a Radiobutton ListControl with a simple interface like[/color][/color]
                  that[color=blue][color=green]
                  > > of a Web Combobox which you can input your own Members with a[/color][/color]
                  Text/values[color=blue]
                  > in[color=green]
                  > > a listcontrol container or you can databind.
                  > >
                  > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                  > message[color=green]
                  > > news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...[color=darkred]
                  > > > OK, that was not clear in your OP. Ken posted link but I have not[/color][/color]
                  > checked[color=green][color=darkred]
                  > > > that out, if you are still having difficulties by tomorrow, I'll try[/color][/color][/color]
                  and[color=blue][color=green][color=darkred]
                  > > > help
                  > > >
                  > > > --
                  > > >
                  > > > OHM ( Terry Burns )
                  > > > . . . One-Handed-Man . . .
                  > > >
                  > > >
                  > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                  > > > news:%23PII9jVW EHA.2928@tk2msf tngp13.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[/color][/color][/color]
                  values[color=blue]
                  > of[color=green][color=darkred]
                  > > > 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[/color][/color]
                  > use[color=green][color=darkred]
                  > > > > Radiobuttons instead of a Checkbox.
                  > > > >
                  > > > > I would love to be able to set all of this with properties instead[/color][/color][/color]
                  of[color=blue][color=green][color=darkred]
                  > > > > programmaticall y with a decision stucture and then binding.
                  > > > >
                  > > > >
                  > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
                  > > > message
                  > > > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...
                  > > > > > OK, to illustrate. Create an access database with two fields in[/color][/color][/color]
                  it.[color=blue]
                  > A[color=green]
                  > > ID[color=darkred]
                  > > > (
                  > > > > > PK ) field and a Yes/No field called 'Data'. Add Three records[/color][/color]
                  > with[color=green][color=darkred]
                  > > > the
                  > > > > > centre on unchecked.
                  > > > > >
                  > > > > > Using server explorer, drag the table to the form and create a[/color]
                  > > DataSet[color=darkred]
                  > > > > > 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[/color][/color][/color]
                  CB[color=blue][color=green][color=darkred]
                  > > > > > disapears and then once again, it appears. You have bound the Data[/color][/color]
                  > to[color=green][color=darkred]
                  > > > the
                  > > > > > control and are using the binding context of the form to move[/color][/color]
                  > through[color=green][color=darkred]
                  > > > the
                  > > > > > bound records.
                  > > > > >
                  > > > > > Voilla !!
                  > > > > >
                  > > > > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e[/color][/color][/color]
                  As[color=blue][color=green][color=darkred]
                  > > > > > System.EventArg s) Handles MyBase.Load
                  > > > > > DA.Fill(Ds1)
                  > > > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
                  > > > > > End Sub
                  > > > > >
                  > > > > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal e[/color][/color]
                  > As[color=green][color=darkred]
                  > > > > > System.EventArg s) Handles btnUP.Click
                  > > > > > Dim bm As BindingManagerB ase
                  > > > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
                  > > > > > bm.Position += 1
                  > > > > > End Sub
                  > > > > >
                  > > > > > --
                  > > > > >
                  > > > > > OHM ( Terry Burns )
                  > > > > > . . . One-Handed-Man . . .
                  > > > > >
                  > > > > >
                  > > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                  > > > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
                  > > > > > > I have looked and searched. What good is the databind property[/color][/color][/color]
                  on[color=blue][color=green][color=darkred]
                  > > > > > > Radiobuttons? How does one go about actually using it? What is[/color][/color][/color]
                  a[color=blue][color=green][color=darkred]
                  > > > good
                  > > > > > > resource on this? I understand that I can easily get/set the
                  > > > > information
                  > > > > > I
                  > > > > > > need programmaticall y, but what about the databind property I[/color][/color][/color]
                  just[color=blue][color=green][color=darkred]
                  > > > don't
                  > > > > > > understand it's value.
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > Rourke Eleven
                  > > > > > > Cthulhu saves sinners - in case he's hungry later!
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • One Handed Man \( OHM - Terry Burns \)

                    #10
                    Re: Radiobuttons Databind

                    Well, in my first reply I showed you how to bind a checkbox to a field in a
                    database. Is this not a valid use ?

                    --

                    OHM ( Terry Burns )
                    . . . One-Handed-Man . . .


                    "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                    news:eYJiS8jWEH A.3528@TK2MSFTN GP10.phx.gbl...[color=blue]
                    > I am not just trying to argue, but what would you bind to the radiobutton?
                    > The Text property? Help me here I am a little lost. Normally I would[/color]
                    want[color=blue]
                    > to bind data so that I could effect a change to the backend data or[/color]
                    display[color=blue]
                    > the data.
                    >
                    > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                    message[color=blue]
                    > news:OYB12ZbWEH A.3120@TK2MSFTN GP12.phx.gbl...[color=green]
                    > > No of course you would not have a single Radio button on a form,[/color][/color]
                    however,[color=blue]
                    > I[color=green]
                    > > personally have used bound radio buttons on a form along with other
                    > > controls. I wrote a helpdesk system and some of the selections were[/color][/color]
                    bound[color=blue]
                    > to[color=green]
                    > > Radio buttons and checkboxes.
                    > >
                    > > It's also possible to display checkboxes on a datagrid bound in the same[/color]
                    > way[color=green]
                    > > with a bit of binding magic and a dice of Controls. But that gets a[/color][/color]
                    little[color=blue][color=green]
                    > > complex.
                    > >
                    > > In asnwer to you question ( and im not Microsoft ) ; why not ?
                    > >
                    > > --
                    > >
                    > > OHM ( Terry Burns )
                    > > . . . One-Handed-Man . . .
                    > >
                    > >
                    > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                    > > news:%2358byLWW EHA.2176@TK2MSF TNGP11.phx.gbl. ..[color=darkred]
                    > > > Ken's answer is great and I think I will use it, but it still doesn't[/color]
                    > > answer[color=darkred]
                    > > > 1 of my questions. Why have databinding on Radiobuttons? What is its[/color]
                    > > use?[color=darkred]
                    > > >
                    > > > I can't think of a time that I would have just a single radiobutton on[/color][/color][/color]
                    a[color=blue][color=green][color=darkred]
                    > > > form. As the Article that Ken sent points out Microsoft needs to[/color][/color][/color]
                    think[color=blue][color=green][color=darkred]
                    > > > about building in a control that does what Duncan Mackenzie does in[/color][/color][/color]
                    his[color=blue][color=green]
                    > > user[color=darkred]
                    > > > control. Make a Radiobutton ListControl with a simple interface like[/color][/color]
                    > that[color=green][color=darkred]
                    > > > of a Web Combobox which you can input your own Members with a[/color][/color]
                    > Text/values[color=green]
                    > > in[color=darkred]
                    > > > a listcontrol container or you can databind.
                    > > >
                    > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                    > > message[color=darkred]
                    > > > news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...
                    > > > > OK, that was not clear in your OP. Ken posted link but I have not[/color]
                    > > checked[color=darkred]
                    > > > > that out, if you are still having difficulties by tomorrow, I'll try[/color][/color]
                    > and[color=green][color=darkred]
                    > > > > help
                    > > > >
                    > > > > --
                    > > > >
                    > > > > OHM ( Terry Burns )
                    > > > > . . . One-Handed-Man . . .
                    > > > >
                    > > > >
                    > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                    > > > > news:%23PII9jVW EHA.2928@tk2msf tngp13.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[/color][/color][/color]
                    of[color=blue][color=green][color=darkred]
                    > > > > > Radiobuttons and using mutual exclusivity.
                    > > > > >
                    > > > > > For example I have field in a database that I want to have the[/color][/color]
                    > values[color=green]
                    > > of[color=darkred]
                    > > > > 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[/color][/color][/color]
                    to[color=blue][color=green]
                    > > use[color=darkred]
                    > > > > > Radiobuttons instead of a Checkbox.
                    > > > > >
                    > > > > > I would love to be able to set all of this with properties instead[/color][/color]
                    > of[color=green][color=darkred]
                    > > > > > programmaticall y with a decision stucture and then binding.
                    > > > > >
                    > > > > >
                    > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote[/color][/color][/color]
                    in[color=blue][color=green][color=darkred]
                    > > > > message
                    > > > > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...
                    > > > > > > OK, to illustrate. Create an access database with two fields in[/color][/color]
                    > it.[color=green]
                    > > A[color=darkred]
                    > > > ID
                    > > > > (
                    > > > > > > PK ) field and a Yes/No field called 'Data'. Add Three records[/color]
                    > > with[color=darkred]
                    > > > > 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[/color][/color][/color]
                    the[color=blue][color=green][color=darkred]
                    > > > > > following
                    > > > > > > code in and run it. You will see by clicking the button once the[/color][/color]
                    > CB[color=green][color=darkred]
                    > > > > > > disapears and then once again, it appears. You have bound the[/color][/color][/color]
                    Data[color=blue][color=green]
                    > > to[color=darkred]
                    > > > > the
                    > > > > > > control and are using the binding context of the form to move[/color]
                    > > through[color=darkred]
                    > > > > the
                    > > > > > > bound records.
                    > > > > > >
                    > > > > > > Voilla !!
                    > > > > > >
                    > > > > > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal[/color][/color][/color]
                    e[color=blue]
                    > As[color=green][color=darkred]
                    > > > > > > System.EventArg s) Handles MyBase.Load
                    > > > > > > DA.Fill(Ds1)
                    > > > > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
                    > > > > > > End Sub
                    > > > > > >
                    > > > > > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal[/color][/color][/color]
                    e[color=blue][color=green]
                    > > As[color=darkred]
                    > > > > > > System.EventArg s) Handles btnUP.Click
                    > > > > > > Dim bm As BindingManagerB ase
                    > > > > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
                    > > > > > > bm.Position += 1
                    > > > > > > End Sub
                    > > > > > >
                    > > > > > > --
                    > > > > > >
                    > > > > > > OHM ( Terry Burns )
                    > > > > > > . . . One-Handed-Man . . .
                    > > > > > >
                    > > > > > >
                    > > > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                    > > > > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
                    > > > > > > > I have looked and searched. What good is the databind[/color][/color][/color]
                    property[color=blue]
                    > on[color=green][color=darkred]
                    > > > > > > > Radiobuttons? How does one go about actually using it? What[/color][/color][/color]
                    is[color=blue]
                    > a[color=green][color=darkred]
                    > > > > good
                    > > > > > > > resource on this? I understand that I can easily get/set the
                    > > > > > information
                    > > > > > > I
                    > > > > > > > need programmaticall y, but what about the databind property I[/color][/color]
                    > just[color=green][color=darkred]
                    > > > > don't
                    > > > > > > > understand it's value.
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > Rourke Eleven
                    > > > > > > > Cthulhu saves sinners - in case he's hungry later!
                    > > > > > > >
                    > > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > >
                    > > > > >
                    > > > >
                    > > > >
                    > > >
                    > > >[/color]
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • One Handed Man \( OHM - Terry Burns \)

                      #11
                      An Object Binding Example

                      Here we have an Class Person. Within it we declare a public event called
                      CheckedChanged, this is made up of the property which the binding manager
                      listens for an event for once binding has been set. When the Property
                      changes from checked to unchecked we call a helper function which raises
                      this event and the binding manager syncs the control ( rad1 ) to this
                      property.

                      Button1.click changes the property of the aPerson object to checked, this is
                      then reflected through the bindings in the rad1 state.

                      On_Load is where we set the bindings

                      HTH

                      Private WithEvents aPerson As New Person

                      Public Class Person

                      Public Event CheckedChanged As EventHandler

                      Private m_checked As Boolean

                      Public Sub New()
                      m_checked = False
                      End Sub

                      Public Property Checked() As Boolean
                      Get
                      Return m_checked
                      End Get
                      Set(ByVal value As Boolean)
                      m_checked = value
                      PropertyChanged (EventArgs.Empt y)
                      End Set
                      End Property

                      Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
                      System.EventArg s) Handles MyBase.Load
                      rad1.DataBindin gs.Add("Checked ", aPerson, "Checked")
                      End Sub

                      Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
                      System.EventArg s) Handles Button1.Click
                      aPerson.checked = True
                      End Sub

                      --

                      OHM ( Terry Burns )
                      . . . One-Handed-Man . . .


                      "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                      news:eYJiS8jWEH A.3528@TK2MSFTN GP10.phx.gbl...[color=blue]
                      > I am not just trying to argue, but what would you bind to the radiobutton?
                      > The Text property? Help me here I am a little lost. Normally I would[/color]
                      want[color=blue]
                      > to bind data so that I could effect a change to the backend data or[/color]
                      display[color=blue]
                      > the data.
                      >
                      > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                      message[color=blue]
                      > news:OYB12ZbWEH A.3120@TK2MSFTN GP12.phx.gbl...[color=green]
                      > > No of course you would not have a single Radio button on a form,[/color][/color]
                      however,[color=blue]
                      > I[color=green]
                      > > personally have used bound radio buttons on a form along with other
                      > > controls. I wrote a helpdesk system and some of the selections were[/color][/color]
                      bound[color=blue]
                      > to[color=green]
                      > > Radio buttons and checkboxes.
                      > >
                      > > It's also possible to display checkboxes on a datagrid bound in the same[/color]
                      > way[color=green]
                      > > with a bit of binding magic and a dice of Controls. But that gets a[/color][/color]
                      little[color=blue][color=green]
                      > > complex.
                      > >
                      > > In asnwer to you question ( and im not Microsoft ) ; why not ?
                      > >
                      > > --
                      > >
                      > > OHM ( Terry Burns )
                      > > . . . One-Handed-Man . . .
                      > >
                      > >
                      > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                      > > news:%2358byLWW EHA.2176@TK2MSF TNGP11.phx.gbl. ..[color=darkred]
                      > > > Ken's answer is great and I think I will use it, but it still doesn't[/color]
                      > > answer[color=darkred]
                      > > > 1 of my questions. Why have databinding on Radiobuttons? What is its[/color]
                      > > use?[color=darkred]
                      > > >
                      > > > I can't think of a time that I would have just a single radiobutton on[/color][/color][/color]
                      a[color=blue][color=green][color=darkred]
                      > > > form. As the Article that Ken sent points out Microsoft needs to[/color][/color][/color]
                      think[color=blue][color=green][color=darkred]
                      > > > about building in a control that does what Duncan Mackenzie does in[/color][/color][/color]
                      his[color=blue][color=green]
                      > > user[color=darkred]
                      > > > control. Make a Radiobutton ListControl with a simple interface like[/color][/color]
                      > that[color=green][color=darkred]
                      > > > of a Web Combobox which you can input your own Members with a[/color][/color]
                      > Text/values[color=green]
                      > > in[color=darkred]
                      > > > a listcontrol container or you can databind.
                      > > >
                      > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                      > > message[color=darkred]
                      > > > news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...
                      > > > > OK, that was not clear in your OP. Ken posted link but I have not[/color]
                      > > checked[color=darkred]
                      > > > > that out, if you are still having difficulties by tomorrow, I'll try[/color][/color]
                      > and[color=green][color=darkred]
                      > > > > help
                      > > > >
                      > > > > --
                      > > > >
                      > > > > OHM ( Terry Burns )
                      > > > > . . . One-Handed-Man . . .
                      > > > >
                      > > > >
                      > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                      > > > > news:%23PII9jVW EHA.2928@tk2msf tngp13.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[/color][/color][/color]
                      of[color=blue][color=green][color=darkred]
                      > > > > > Radiobuttons and using mutual exclusivity.
                      > > > > >
                      > > > > > For example I have field in a database that I want to have the[/color][/color]
                      > values[color=green]
                      > > of[color=darkred]
                      > > > > 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[/color][/color][/color]
                      to[color=blue][color=green]
                      > > use[color=darkred]
                      > > > > > Radiobuttons instead of a Checkbox.
                      > > > > >
                      > > > > > I would love to be able to set all of this with properties instead[/color][/color]
                      > of[color=green][color=darkred]
                      > > > > > programmaticall y with a decision stucture and then binding.
                      > > > > >
                      > > > > >
                      > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote[/color][/color][/color]
                      in[color=blue][color=green][color=darkred]
                      > > > > message
                      > > > > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...
                      > > > > > > OK, to illustrate. Create an access database with two fields in[/color][/color]
                      > it.[color=green]
                      > > A[color=darkred]
                      > > > ID
                      > > > > (
                      > > > > > > PK ) field and a Yes/No field called 'Data'. Add Three records[/color]
                      > > with[color=darkred]
                      > > > > 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[/color][/color][/color]
                      the[color=blue][color=green][color=darkred]
                      > > > > > following
                      > > > > > > code in and run it. You will see by clicking the button once the[/color][/color]
                      > CB[color=green][color=darkred]
                      > > > > > > disapears and then once again, it appears. You have bound the[/color][/color][/color]
                      Data[color=blue][color=green]
                      > > to[color=darkred]
                      > > > > the
                      > > > > > > control and are using the binding context of the form to move[/color]
                      > > through[color=darkred]
                      > > > > the
                      > > > > > > bound records.
                      > > > > > >
                      > > > > > > Voilla !!
                      > > > > > >
                      > > > > > > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal[/color][/color][/color]
                      e[color=blue]
                      > As[color=green][color=darkred]
                      > > > > > > System.EventArg s) Handles MyBase.Load
                      > > > > > > DA.Fill(Ds1)
                      > > > > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
                      > > > > > > End Sub
                      > > > > > >
                      > > > > > > Private Sub btnUP_Click(ByV al sender As System.Object, ByVal[/color][/color][/color]
                      e[color=blue][color=green]
                      > > As[color=darkred]
                      > > > > > > System.EventArg s) Handles btnUP.Click
                      > > > > > > Dim bm As BindingManagerB ase
                      > > > > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
                      > > > > > > bm.Position += 1
                      > > > > > > End Sub
                      > > > > > >
                      > > > > > > --
                      > > > > > >
                      > > > > > > OHM ( Terry Burns )
                      > > > > > > . . . One-Handed-Man . . .
                      > > > > > >
                      > > > > > >
                      > > > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                      > > > > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
                      > > > > > > > I have looked and searched. What good is the databind[/color][/color][/color]
                      property[color=blue]
                      > on[color=green][color=darkred]
                      > > > > > > > Radiobuttons? How does one go about actually using it? What[/color][/color][/color]
                      is[color=blue]
                      > a[color=green][color=darkred]
                      > > > > good
                      > > > > > > > resource on this? I understand that I can easily get/set the
                      > > > > > information
                      > > > > > > I
                      > > > > > > > need programmaticall y, but what about the databind property I[/color][/color]
                      > just[color=green][color=darkred]
                      > > > > don't
                      > > > > > > > understand it's value.
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > > Rourke Eleven
                      > > > > > > > Cthulhu saves sinners - in case he's hungry later!
                      > > > > > > >
                      > > > > > > >
                      > > > > > >
                      > > > > > >
                      > > > > >
                      > > > > >
                      > > > >
                      > > > >
                      > > >
                      > > >[/color]
                      > >
                      > >[/color]
                      >
                      >[/color]


                      Comment

                      • One Handed Man \( OHM - Terry Burns \)

                        #12
                        PS

                        I forgot to include the forms class level declaration of the aPerson

                        Private WithEvents aPerson As New Person



                        Cheers


                        --

                        OHM ( Terry Burns )
                        . . . One-Handed-Man . . .


                        "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in message
                        news:%23VudidpW EHA.3988@tk2msf tngp13.phx.gbl. ..[color=blue]
                        > Here we have an Class Person. Within it we declare a public event called
                        > CheckedChanged, this is made up of the property which the binding manager
                        > listens for an event for once binding has been set. When the Property
                        > changes from checked to unchecked we call a helper function which raises
                        > this event and the binding manager syncs the control ( rad1 ) to this
                        > property.
                        >
                        > Button1.click changes the property of the aPerson object to checked, this[/color]
                        is[color=blue]
                        > then reflected through the bindings in the rad1 state.
                        >
                        > On_Load is where we set the bindings
                        >
                        > HTH
                        >
                        > Private WithEvents aPerson As New Person
                        >
                        > Public Class Person
                        >
                        > Public Event CheckedChanged As EventHandler
                        >
                        > Private m_checked As Boolean
                        >
                        > Public Sub New()
                        > m_checked = False
                        > End Sub
                        >
                        > Public Property Checked() As Boolean
                        > Get
                        > Return m_checked
                        > End Get
                        > Set(ByVal value As Boolean)
                        > m_checked = value
                        > PropertyChanged (EventArgs.Empt y)
                        > End Set
                        > End Property
                        >
                        > Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
                        > System.EventArg s) Handles MyBase.Load
                        > rad1.DataBindin gs.Add("Checked ", aPerson, "Checked")
                        > End Sub
                        >
                        > Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
                        > System.EventArg s) Handles Button1.Click
                        > aPerson.checked = True
                        > End Sub
                        >
                        > --
                        >
                        > OHM ( Terry Burns )
                        > . . . One-Handed-Man . . .
                        >
                        >
                        > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                        > news:eYJiS8jWEH A.3528@TK2MSFTN GP10.phx.gbl...[color=green]
                        > > I am not just trying to argue, but what would you bind to the[/color][/color]
                        radiobutton?[color=blue][color=green]
                        > > The Text property? Help me here I am a little lost. Normally I would[/color]
                        > want[color=green]
                        > > to bind data so that I could effect a change to the backend data or[/color]
                        > display[color=green]
                        > > the data.
                        > >
                        > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in[/color]
                        > message[color=green]
                        > > news:OYB12ZbWEH A.3120@TK2MSFTN GP12.phx.gbl...[color=darkred]
                        > > > No of course you would not have a single Radio button on a form,[/color][/color]
                        > however,[color=green]
                        > > I[color=darkred]
                        > > > personally have used bound radio buttons on a form along with other
                        > > > controls. I wrote a helpdesk system and some of the selections were[/color][/color]
                        > bound[color=green]
                        > > to[color=darkred]
                        > > > Radio buttons and checkboxes.
                        > > >
                        > > > It's also possible to display checkboxes on a datagrid bound in the[/color][/color][/color]
                        same[color=blue][color=green]
                        > > way[color=darkred]
                        > > > with a bit of binding magic and a dice of Controls. But that gets a[/color][/color]
                        > little[color=green][color=darkred]
                        > > > complex.
                        > > >
                        > > > In asnwer to you question ( and im not Microsoft ) ; why not ?
                        > > >
                        > > > --
                        > > >
                        > > > OHM ( Terry Burns )
                        > > > . . . One-Handed-Man . . .
                        > > >
                        > > >
                        > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                        > > > news:%2358byLWW EHA.2176@TK2MSF TNGP11.phx.gbl. ..
                        > > > > Ken's answer is great and I think I will use it, but it still[/color][/color][/color]
                        doesn't[color=blue][color=green][color=darkred]
                        > > > answer
                        > > > > 1 of my questions. Why have databinding on Radiobuttons? What is[/color][/color][/color]
                        its[color=blue][color=green][color=darkred]
                        > > > use?
                        > > > >
                        > > > > I can't think of a time that I would have just a single radiobutton[/color][/color][/color]
                        on[color=blue]
                        > a[color=green][color=darkred]
                        > > > > form. As the Article that Ken sent points out Microsoft needs to[/color][/color]
                        > think[color=green][color=darkred]
                        > > > > about building in a control that does what Duncan Mackenzie does in[/color][/color]
                        > his[color=green][color=darkred]
                        > > > user
                        > > > > control. Make a Radiobutton ListControl with a simple interface[/color][/color][/color]
                        like[color=blue][color=green]
                        > > that[color=darkred]
                        > > > > of a Web Combobox which you can input your own Members with a[/color]
                        > > Text/values[color=darkred]
                        > > > in
                        > > > > a listcontrol container or you can databind.
                        > > > >
                        > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com> wrote in
                        > > > message
                        > > > > news:eH99i2VWEH A.1128@TK2MSFTN GP10.phx.gbl...
                        > > > > > OK, that was not clear in your OP. Ken posted link but I have not
                        > > > checked
                        > > > > > that out, if you are still having difficulties by tomorrow, I'll[/color][/color][/color]
                        try[color=blue][color=green]
                        > > and[color=darkred]
                        > > > > > help
                        > > > > >
                        > > > > > --
                        > > > > >
                        > > > > > OHM ( Terry Burns )
                        > > > > > . . . One-Handed-Man . . .
                        > > > > >
                        > > > > >
                        > > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                        > > > > > news:%23PII9jVW EHA.2928@tk2msf tngp13.phx.gbl. ..
                        > > > > > > For all others this is regarding VB.Net Windows Forms not[/color][/color][/color]
                        ASP.Net[color=blue][color=green][color=darkred]
                        > > > > > >
                        > > > > > > Terry,
                        > > > > > >
                        > > > > > > Ok I understand that but what about in the the context of a[/color][/color][/color]
                        group[color=blue]
                        > of[color=green][color=darkred]
                        > > > > > > Radiobuttons and using mutual exclusivity.
                        > > > > > >
                        > > > > > > For example I have field in a database that I want to have the[/color]
                        > > values[color=darkred]
                        > > > 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[/color][/color][/color]
                        wanted[color=blue]
                        > to[color=green][color=darkred]
                        > > > use
                        > > > > > > Radiobuttons instead of a Checkbox.
                        > > > > > >
                        > > > > > > I would love to be able to set all of this with properties[/color][/color][/color]
                        instead[color=blue][color=green]
                        > > of[color=darkred]
                        > > > > > > programmaticall y with a decision stucture and then binding.
                        > > > > > >
                        > > > > > >
                        > > > > > > "One Handed Man ( OHM - Terry Burns )" <news.microsoft .com>[/color][/color][/color]
                        wrote[color=blue]
                        > in[color=green][color=darkred]
                        > > > > > message
                        > > > > > > news:OkQ0qoPWEH A.3420@TK2MSFTN GP12.phx.gbl...
                        > > > > > > > OK, to illustrate. Create an access database with two fields[/color][/color][/color]
                        in[color=blue][color=green]
                        > > it.[color=darkred]
                        > > > A
                        > > > > ID
                        > > > > > (
                        > > > > > > > PK ) field and a Yes/No field called 'Data'. Add Three[/color][/color][/color]
                        records[color=blue][color=green][color=darkred]
                        > > > with
                        > > > > > the
                        > > > > > > > centre on unchecked.
                        > > > > > > >
                        > > > > > > > Using server explorer, drag the table to the form and create[/color][/color][/color]
                        a[color=blue][color=green][color=darkred]
                        > > > > DataSet
                        > > > > > > > DS(DS1) using the wizard.
                        > > > > > > >
                        > > > > > > > Drag a Checkbox onto your form (cb1) and a button (btnUP), put[/color][/color]
                        > the[color=green][color=darkred]
                        > > > > > > following
                        > > > > > > > code in and run it. You will see by clicking the button once[/color][/color][/color]
                        the[color=blue][color=green]
                        > > CB[color=darkred]
                        > > > > > > > disapears and then once again, it appears. You have bound the[/color][/color]
                        > Data[color=green][color=darkred]
                        > > > to
                        > > > > > the
                        > > > > > > > control and are using the binding context of the form to move
                        > > > through
                        > > > > > the
                        > > > > > > > bound records.
                        > > > > > > >
                        > > > > > > > Voilla !!
                        > > > > > > >
                        > > > > > > > Private Sub Form1_Load(ByVa l sender As System.Object,[/color][/color][/color]
                        ByVal[color=blue]
                        > e[color=green]
                        > > As[color=darkred]
                        > > > > > > > System.EventArg s) Handles MyBase.Load
                        > > > > > > > DA.Fill(Ds1)
                        > > > > > > > CB1.DataBinding s.Add("Checked" , Ds1.Tables(0), "Data")
                        > > > > > > > End Sub
                        > > > > > > >
                        > > > > > > > Private Sub btnUP_Click(ByV al sender As System.Object,[/color][/color][/color]
                        ByVal[color=blue]
                        > e[color=green][color=darkred]
                        > > > As
                        > > > > > > > System.EventArg s) Handles btnUP.Click
                        > > > > > > > Dim bm As BindingManagerB ase
                        > > > > > > > bm = Me.BindingConte xt.Item(Ds1.Tab les(0))
                        > > > > > > > bm.Position += 1
                        > > > > > > > End Sub
                        > > > > > > >
                        > > > > > > > --
                        > > > > > > >
                        > > > > > > > OHM ( Terry Burns )
                        > > > > > > > . . . One-Handed-Man . . .
                        > > > > > > >
                        > > > > > > >
                        > > > > > > > "Rourke Eleven" <Rourke11@hotma il.com> wrote in message
                        > > > > > > > news:uYl4UIOWEH A.2544@TK2MSFTN GP10.phx.gbl...
                        > > > > > > > > I have looked and searched. What good is the databind[/color][/color]
                        > property[color=green]
                        > > on[color=darkred]
                        > > > > > > > > Radiobuttons? How does one go about actually using it?[/color][/color][/color]
                        What[color=blue]
                        > is[color=green]
                        > > a[color=darkred]
                        > > > > > good
                        > > > > > > > > resource on this? I understand that I can easily get/set[/color][/color][/color]
                        the[color=blue][color=green][color=darkred]
                        > > > > > > information
                        > > > > > > > I
                        > > > > > > > > need programmaticall y, but what about the databind property[/color][/color][/color]
                        I[color=blue][color=green]
                        > > just[color=darkred]
                        > > > > > don't
                        > > > > > > > > understand it's value.
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > > > Rourke Eleven
                        > > > > > > > > Cthulhu saves sinners - in case he's hungry later!
                        > > > > > > > >
                        > > > > > > > >
                        > > > > > > >
                        > > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > >
                        > > > > >
                        > > > >
                        > > > >
                        > > >
                        > > >[/color]
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        Working...