473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Databinding to a checkbox

Hi,

I have a datafield containing Y or N. I would like to databind to the
checkbox, and tell it that Y denotes the checked state and N denotes the
unchecked state. In fact, I would like to be able to do something like this
to arbitrary values which should denote the checked and uncheck state (i.e.
'Available' for checked and 'Unavailable' for unchecked).

Is this possible?

Thanks
Jul 21 '05 #1
2 1068
Check out the Parse and Format events in the Binding class

/claes

"Marina" <so*****@nospam.com> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a datafield containing Y or N. I would like to databind to the
checkbox, and tell it that Y denotes the checked state and N denotes the
unchecked state. In fact, I would like to be able to do something like this to arbitrary values which should denote the checked and uncheck state (i.e. 'Available' for checked and 'Unavailable' for unchecked).

Is this possible?

Thanks

Jul 21 '05 #2
Ok, thanks. That can do the trick, though what a pain.

"Claes Bergefall" <cl*************@online.nospam> wrote in message
news:eE*************@TK2MSFTNGP15.phx.gbl...
Check out the Parse and Format events in the Binding class

/claes

"Marina" <so*****@nospam.com> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a datafield containing Y or N. I would like to databind to the
checkbox, and tell it that Y denotes the checked state and N denotes the
unchecked state. In fact, I would like to be able to do something like

this
to arbitrary values which should denote the checked and uncheck state

(i.e.
'Available' for checked and 'Unavailable' for unchecked).

Is this possible?

Thanks


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff | last post by:
I am having a behaviour problem with Databinding on a C# WinForm. I have three textboxes and a Checkbox bound to a dataset. The desired behaviour is when I check/uncheck the checkbox, I want to...
2
by: sdeezdaone | last post by:
I've got two tables that are linked by a field. The first table contains a list of items (like a checklist). The second table contains the corresponding a record for each user and each checklist...
1
by: Baskar RajaSekharan | last post by:
Hi, I have one Doubt in C#. I bound one CheckBox control to the Dataset column. when Leave the Checkbox using the Tab, the Value of the Check box is automaticllay set it to Zer 0r False. ...
4
by: aroth | last post by:
I have a basic form with some dropdownlist controls that I would like to populate with items from a database. I keep getting the error "Cannot implicitly convert type...
2
by: Martin | last post by:
Hi, Please can somebody explain how databinding is done on a checkbox list. I have the follwoing code which I would have thought was enough to databind a checkbox, but apparently not. The...
1
by: Tom | last post by:
Hi there I have a little problem here, wich i think is quite strange... I have a dataset, filled from my SQL database. In it are some boolean fields (or bit as SQL server calls them) Now, on...
6
by: M | last post by:
I binding controls to a dataset at design time. I find the checkboxs will cause the program crash when one of these databinding fields is dbnull. The only way for me is not set databindings for...
1
by: novato | last post by:
Hello, this is my first post, I´m new in C# and i´m developing a capture for a test helth for babies (tamiz), I´m making a capture screen with text box and checkbox. For databinding textbox I don´t...
0
by: novato | last post by:
Hello, this is my first post, I´m new in C# and i´m developing a capture for a test helth for babies (tamiz), I´m making a capture screen with text box and checkbox. For databinding textbox I don´t...
1
by: JeffN825 | last post by:
Hi, I've been struggling with a databinding nuance for a bunch of hours now, so I figured I'd post out for help. I need to databind a control to an object. The control does not have a parent. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.