We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to account for empty dates

Thread ID:





69567 Nov 1,2007 08:23 PM Nov 2,2007 12:49 PM ASP.NET Web Forms (Classic) 2
Tags: GridGroupingControl
Ivan Siew
Asked On November 1, 2007 08:23 PM

I am returning an empty string from SQL to a monthcalendar field so that it would be "blank" in the grid, i.e. the user did not enter a date.

However, when I want to edit that row now, it hangs due to the monthcalendar not recognizing a date (empty string).

Is there a way to somehow set the monthcalendar to today's date if the datamapping coming from SQL is a blank empty string?

I tried to setValue using today's date in the beginedit action. It seemed to work until I click the cancel button, the value remained.

If the value started out as blank, I still want to make it blank when cancelling the event.

Any thoughts?

Ivan Siew
Replied On November 2, 2007 08:54 AM

Hi, I am rephrasing this question.
Basically, in the gridgrouping control, how would you enable the monthcalendar control to automatically show today's date during edit mode, just like when you are adding a new row. But instead this is in edit mode of a blank column.



Ivan Siew
Replied On November 2, 2007 12:49 PM

Ok, I found out how to go about this.

If you are using monthcalendar in the grid, set the CellValueType="System.DateTime". This currently resolves my issue.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.