Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Best way to handle dates in a gridview?

Reply
Thread Tools

Best way to handle dates in a gridview?

 
 
trevi
Guest
Posts: n/a
 
      11-27-2007
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.
 
Reply With Quote
 
 
 
 
bruce barker (sqlwork.com)
Guest
Posts: n/a
 
      11-27-2007
I's store null in the database and use blank in the list.

-- bruce (sqlwork.com)


"trevi" wrote:

> 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.

 
Reply With Quote
 
 
 
 
trevi
Guest
Posts: n/a
 
      11-27-2007
I think that's probably better. Thanks Bruce.
"bruce barker (sqlwork.com)" wrote:

> I's store null in the database and use blank in the list.
>
> -- bruce (sqlwork.com)
>
>
> "trevi" wrote:
>
> > 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.

 
Reply With Quote
 
trevi
Guest
Posts: n/a
 
      11-27-2007
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-

"bruce barker (sqlwork.com)" wrote:

> I's store null in the database and use blank in the list.
>
> -- bruce (sqlwork.com)
>
>
> "trevi" wrote:
>
> > 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.

 
Reply With Quote
 
trevi
Guest
Posts: n/a
 
      11-27-2007
I found an article where it says you can use 'optional' parameters. that part
seems to work. It just caused problems with other areas ........

"trevi" wrote:

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RFC-822 dates into Ruby dates kellygreer1 Ruby 1 06-08-2008 10:59 PM
Need to use dates earlier than 1900 (Time library says out of range for dates < 1900) me@benjaminarai.com Ruby 1 07-17-2007 02:25 PM
FAQ Dates; Opera Dates. Dr J R Stockton Javascript 0 06-18-2007 03:51 PM
Dates dates dates dates... SQL and ASP.NET David Lozzi ASP .Net 1 09-30-2005 02:18 PM
Dates! Dates! Dates! PW ASP General 4 08-09-2004 04:42 PM



Advertisments