Mapping a boolean field in a SQL CE database to a human-friendly DataGrid column

  • Thread starter Jared Miniman [MVP]
  • Start date
J

Jared Miniman [MVP]

Pretty basic: I have a boolean column in a SQL DB and am using a DataView as
the source for my DataGrid. In the DataGrid, I want to map values "true" to
X and "false" to Y so that I see the mapped values in the DataGrid rather
than the boolean equivalent. How dirty do I need to get with my DataAdapter
select statements to make this happen? Does anyone have any suggestions?
It's a pretty strict requirement made by my client but I'm not sure the
easiest/quickest way to approach this...

--
_________________________________
Jared Miniman, MS-MVP Mobile Devices
Mobile Computer Consultant

ActiveSync problems?
http://www.microsoft.com/mobile/pocketpc/support/help/activesync.asp
Connection Mngr Q's?
http://www.microsoft.com/mobile/pocketpc/tutorials/connectionmanager
 
A

Alex Feinman [MVP]

Add a calculated column based on expression:
IIF(<bool column>, 'Y', 'N')
and map your grid column to it. Adding expression-based column is best done
after call to DataAdapter.Fill(DataTable)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top