Best way to handle dates in a gridview?

  • Thread starter Thread starter trevi
  • Start date Start date
T

trevi

hi,

I've got a gridviw that has fields that relate to datefields, actually I
only care about the time in these fields. I display them as drop-down lists
so user can change the date when in edit mode. My problem is that sometimes,
the user does not have to fill in a time. In this case, I am not sure what to
do. I thought of:
1. putting in some odd date I know they never will input, then maybe not
display it in the gridview... dorky.
2. putting a blank in the drop-down selection, but then I have a hard time
handling a blank for a date field.

what is the best option? I appreciate your input. thanks.
 
I's store null in the database and use blank in the list.

-- bruce (sqlwork.com)
 
I managed to get around blank dates in the rowdatabound event, but I'm having
problems in the rowupdating event. I tried setting the field to a blank
string and of course it didn't like it. I'm updating the table with a stored
procedure. I set the fields in my code. How do I pass a parameter of blank to
a datetime field?
thanks-
 
I found an article where it says you can use 'optional' parameters. that part
seems to work. It just caused problems with other areas :( ........
 
Back
Top