SmartDate and DataGridViewsSmartDate and DataGridViews
Old forum URL: forums.lhotka.net/forums/t/277.aspx
ajj3085 posted on Monday, June 05, 2006
Hi,
Has anyone else gotten an error when they try to blank a datagridview cell who's backer is a SmartDate?
It looks like the DGV wants to stuff a System.DBNull in as the value for the SmartDate property; this results in an error since DBNull can't be converted to SmartDate.
Anyone else come across this?
Andy
esteban404 replied on Monday, June 05, 2006
Yea, it happened to me. My grid has a parse edit value event in which I intercept the data, might be a binding event or similar in your grid:
if(value == System.DBNull || value == null)
value = string.Empty;
BTW, I do the same thing for calendar controls.
_E
ajj3085 replied on Tuesday, June 06, 2006
Thanks Esteban,
I found another solution; you can set the NullValue property in the template for the column, and set it to "". This acomplishes the same thing.
Andy
Copyright (c) Marimer LLC