S
Sean
I am using a GridView to display and edit rows of data. I am having
problems with one of my GridViews that has a Calendar control in it. If
the data coming back from the DB doesn't have a date for this field, I
get a 'Specified Cast is Invalid' message when the empty string is
being bound to the SelectedValue of the Calendar control. That makes
sense.
What I need to do (I think), is somehow intercept the process so that
if I have a DB date that is null, I can tell the Calendar control to
use it's default value of '1/1/0001 12:00:00 AM' for the SelectedValue
property when going into edit mode.
In the RowEditing event I was able to determine that the Label control
(ItemTemplate) for the date column was an empty string. I did this
using FindControl, but I cannot seem to figure out how to find the
Calendar control (EditItemTemplate) so that I can tell it to use the
default date instead of trying to bind the empty string.
Any ideas?
problems with one of my GridViews that has a Calendar control in it. If
the data coming back from the DB doesn't have a date for this field, I
get a 'Specified Cast is Invalid' message when the empty string is
being bound to the SelectedValue of the Calendar control. That makes
sense.
What I need to do (I think), is somehow intercept the process so that
if I have a DB date that is null, I can tell the Calendar control to
use it's default value of '1/1/0001 12:00:00 AM' for the SelectedValue
property when going into edit mode.
In the RowEditing event I was able to determine that the Label control
(ItemTemplate) for the date column was an empty string. I did this
using FindControl, but I cannot seem to figure out how to find the
Calendar control (EditItemTemplate) so that I can tell it to use the
default date instead of trying to bind the empty string.
Any ideas?