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. Image for the cookie policy date
close icon

How to account for empty dates

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?

2 Replies

IS Ivan Siew November 2, 2007 12:54 PM UTC

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.

THanks.

Ivan


IS Ivan Siew November 2, 2007 04:49 PM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon