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


Thread ID:





39326 Jan 4,2006 04:23 PM UTC Jan 5,2006 05:03 AM UTC WinForms 1
Tags: Tools
Lan Mo
Asked On January 4, 2006 04:23 PM UTC

Hello, I use DateTimePickAdv control bound to a table field with datatime type. When the field date is null, it got "object can''t cast from DBNull to other types". any settings I need to set up? Thanks, The code I used: DateTimePickerAdv pDateTimePicker=new DateTimePickerAdv(); pDateTimePicker.Name=string.Format("dt{0}",ColumnName); pDateTimePicker.Tag=ColumnName; pDateTimePicker.EnableNullDate=true; // bound to table field ptmpDateTimePicker.DataBindings.Add("Value",mGridDataSet.Tables[mFormParam.TableName],ColumnName);

Administrator [Syncfusion]
Replied On January 5, 2006 05:03 AM UTC

Hi LanMo, For a DateTimePickerAdv, you need to bind to the BindableValue property. Please see the below given code snippet : ptmpDateTimePicker.DataBindings.Add(new System.Windows.Forms.Binding("BindableValue", mGridDataSet.Tables[mFormParam.TableName],ColumnName); Also please take a look at the following KB Article. How can you setup databinding to your DateTimePickerAdv ? Best Regards, Anu.


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