-
January 20th, 2010, 06:02 AM
#1
XtraReports
Haii. I have a lot of Y & N (yes & no) fields in an Mysql database. They are basically boolean but are stored as varchar 'Y' or 'N'. I want to display checkboxes which are checked while the database value is 'Y' and to unchecked while database field value is 'N'Whats the best way to bind a XRCheckBox to do these?How i can do it?please help me...
-
January 20th, 2010, 07:00 AM
#2
Re: XtraReports
If it is possible, I would change de DB column to BIT instead of VARCHAR.
If not, you could create a property that returns a boolean instead of a string. Something like
Code:
private string _MyField; //store the DB value in this field
public bool MyField{
get{
return _MyField == "Y";
}
set{
_MyField = (value ? "Y" : "N");
}
}
Bind this property to the checkbox
-
January 20th, 2010, 07:43 AM
#3
Re: XtraReports
Or, if you have binded the check box to a table in dataset, add fake counted (expression property, I think) column to the table based on rule mentioned by dannystommen and bind the check-box to it.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|