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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display blank cell in DataGrid when binding to non-nullable property

Status
Not open for further replies.

dragonwell

Programmer
Joined
Oct 21, 2002
Messages
863
Location
US
I am binding my DataGrid to an ArrayList of objects. One of the properties in my object is an Integer. If the value of the integer property = Int32.MinValue, I want the cell to show blank or string of my choosing (like you can if using a DataSet and the column is dbnull). Can this be done?

Thanks

 
Well, that was easy - just add another property to the object that exposes the integer as a string, and has the conversion logic in the getter and setter. Map the DataGrid column to that instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top