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

How to set null in GridDateTimeColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

141133 Nov 26,2018 11:08 AM UTC Nov 27,2018 08:47 AM UTC WinForms 1
loading
Tags: SfDataGrid
mariusz Jakoniuk
Asked On November 26, 2018 11:12 AM UTC

Hello.
I have set the date in the GridDateTimeColumns pool to change this value to null. Validation set to "none", the field set "AllowNull = true".

I am sorry to translate from Polish to English on Google

Deivaselvan Y [Syncfusion]
Replied On November 27, 2018 08:47 AM UTC

Hi Mariusz, 
 
Thanks for contacting Syncfusion support.  

To set null value for a GridDateTimeColumn the underlying property of the DateTimeColumn must be of nullable DateTime type. Please refer to the following code example and sample from the given location.  

Code example :  

/// <summary> 
/// Gets or Sets the OrderDate 
/// </summary> 
[Display(Name = "Order Date")] 
public DateTime? OrderDate 
{ 
    get 
    { 
        return _orderDate; 
    } 
    set 
    { 
        _orderDate = value; 
    } 
} 




You can set null value for a DateTimeColumn by opening the calendar dropdown and select None option from the bottom of the calendar. 

 

Regards, 
Deivaselvan 


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.

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

;