Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying ''Y'' / ''N'' instead of checkboxes in a DataGridView

Status
Not open for further replies.

DayLaborer

Programmer
Jan 3, 2006
347
US
I have list that has a Boolean valued column. When I set the DataGridView.DataSource to the list, it displays nicely, but it defaults to displaying the Boolean column with checkboxes. I need it to show "Y" or "N" instead. I was able to hack it by hiding the real columns and creating new ones of type String, but that seems ...hacked.

How can I get it to display my Boolean column with "Y" and "N"?

Thanks,
Eliezer
 
There are probably 2 approaches to take.
1. override the column behavior, remove the default column and replace with your own implementation.
2. structure the data of the view to be a string (Y/N) rather than a Boolean value. bind this structure to the grid.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top