Results 1 to 2 of 2

Thread: Help with databound checkbox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    258

    Question Help with databound checkbox

    I have a pre-existing database which I am coding to, so I can't change the data stored in the SQL-Server 2005 database.

    My application uses the DataGridView to maintain the data. There is a yes/no field that I would like to bind a checkbox to. The field is a character field in the database, and holds either Y or N. So, here's the question.

    I know how to set the column to be a checkbox, I think, but I don't know how to map it so that it reads/stores a "Y" value as checked and a "N" value as unchecked.

    Any ideas how I do this?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Help with databound checkbox

    The column has TrueValue and FalseValue properties.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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
  •  



Click Here to Expand Forum to Full Width