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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to edit a nullable time in a grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

15706 Jun 24,2004 11:02 PM UTC Jun 25,2004 07:33 PM UTC WinForms 3
loading
Tags: GridControl
Andy
Asked On June 24, 2004 11:02 PM UTC

I want to be able to edit a time value (hh:mm [am|pm]) in a grid, but it must also be nullable and the user must get a meaningful error if they have entered somethign incorrectly. I think i''d prefer free text that is flexible to allow the user to enter 10am or 10:00am or 10:30. having to click an up arrow to set a time can be very annoying. the trickier part is that is needs to be DBNull-able, so I would expect i''d want to let the user hit delete to delete it. whats the best approach? thanks -andy

Administrator [Syncfusion]
Replied On June 24, 2004 11:10 PM UTC

what i did so far was to add ''t'' as the format string, which allows me to enter a time but a) it complains with an exception if i enter an invalid time b) i cant enter a null time c) the value is not evaluated until i move to a different row. when i tab to another column in the same row (or hit return) it doesnt evaluate the text i have entered what should i be doing? thanks -andy

Administrator [Syncfusion]
Replied On June 25, 2004 06:35 AM UTC

You need to be using our 2.0 code base (or at least 1618 ???) to handle null DateTime''s. In those versions, there should not be a problem having an empty DateTime field unless you are bound to a datatable that does not allow null''s in the column. In that case, you will have to change the column in the DataTable to accept nulls. As far as accepting flexible strings and prviding your own error message, you can do that by handling CurrentCellValidating. Here is a little sample. NullableDateTime_3521.zip

Administrator [Syncfusion]
Replied On June 25, 2004 07:33 PM UTC

great, thanks i am using 2.0 and its the CurrentCellValidating ''thing'' i was lookign for :) >You need to be using our 2.0 code base (or at least 1618 ???) to handle null DateTime''s. In those versions, there should not be a problem having an empty DateTime field unless you are bound to a datatable that does not allow null''s in the column. In that case, you will have to change the column in the DataTable to accept nulls. > >As far as accepting flexible strings and prviding your own error message, you can do that by handling CurrentCellValidating. Here is a little sample. > >NullableDateTime_3521.zip > >

CONFIRMATION

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.

Warning Icon 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.Close Icon

;