Welcome Guest Search | Active Topics | Sign In | Register

date picker - handling null value Options
Jason
Posted: Tuesday, February 7, 2012 2:36:42 AM
Rank: Member
Groups: Member

Joined: 10/18/2010
Posts: 29
Hello

I am using a datepicker control inside a template field inside an asp.net gridview. If I attempt to edit the record that stores the date information, but the date field is null, when the page attempts to load, it throws an error to say Conversion from type 'DBNull' to type 'Date' is not valid..

Is there a property in the datepicker control that I can modify to accommodate this?

Thanks
eo_support
Posted: Tuesday, February 7, 2012 9:27:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would bind to SelectedDateString instead of SelectedDate. SelectedDate is a DateTime value and it does not have null value.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.