Binding Radio Buttons
Posted on 2009-07-16
Hi Thanks for clicking.
This is something you'd think was easy, but the hassle it's given me.
Want to Bind to 7 radio buttons a Text database field
This Text field can have 7 states, namely Intruder, Fire, Access, Social, Vehicle, CCTV and Other
Obviously the 7 buttons fit exactly to this. So obviously we choose the appropriate one upon Binding.
However, what do we bind to?? Thought of using a FlowPanel ( a fancy panel) , and using the Tag property of this to bind to this field. After that we interpret the Tag property and therefore check or uncheck the appropriate radio button.
Vice Versa, when we change the Radio button we manually change the Tag property of the Panel, and therefore should upload as normal on save like any other control on our form.
Which property and what event of the Panel shoud I use to do this job?? Tried using the Tag property and BindingContextChanged event, but doesn't change the Tag property for some reason, even though it's bound.
We use VS2005 and SQLSERVER2005
I'd be most grateful