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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I prefill a DataGrid cell with the current date/time

Thread ID:




3841 Apr 12,2003 08:25 PM UTC WinForms 0
Tags: FAQ
Steve Philcox
Asked On April 12, 2003 08:25 PM UTC

I have seen code that suggests setting the Default property of the DataColumn in the corresponding DataTable to DateTime.Now. This solution uses the date/time at the moment of that call. How do I insert the "real" current date/time? Is it possible to run "code" to supply a value? I have the column set as readonly, and as part of the primary key. I have not been able to find another way to fill the field when a new row is to be added in the DataGrid. Is there an event that is triggered when a new row is to be added, and can I add a handler? Thanks.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon