473,469 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1070
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.