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

always say it is not valid value of date time

Thread ID:

Created:

Updated:

Platform:

Replies:

77350 Oct 28,2008 03:04 PM UTC Nov 6,2008 09:28 AM UTC WinForms 6
loading
Tags: GridControl
David Cui
Asked On October 28, 2008 03:04 PM UTC


i am using databoundgrid, i have a DateTime column in my datatable. when i bound to grid, i formated that cell to MM/dd/yyyy HH:mm:ss from preparedView. the default time portion is 00:00:00 . the problem is, if i mannually change the 00:00:00 to any thing 01:00:00 or similar. The grid complain it about "invalid value of datetime". any shining points to help ?

david


David Cui
Replied On October 29, 2008 09:26 PM UTC


any answer to this question ?


>
i am using databoundgrid, i have a DateTime column in my datatable. when i bound to grid, i formated that cell to MM/dd/yyyy HH:mm:ss from preparedView. the default time portion is 00:00:00 . the problem is, if i mannually change the 00:00:00 to any thing 01:00:00 or similar. The grid complain it about "invalid value of datetime". any shining points to help ?

david




Jisha Joy [Syncfusion]
Replied On October 30, 2008 11:22 AM UTC

Hi David,

Thak you for your interest in Syncfusion Products.

I have tested the issue on a simple sample. But I am afraid I was not able to reproduce the issue. Please refer the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/GGCDateTimeFormattingIssue.zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Regards,
Jisha




David Cui
Replied On October 30, 2008 01:47 PM UTC


you are using GridGroupControl which I am using GridDataBoundGrid. what I did is simple just implment prepareview, e.Style.Format = "MM/dd/yyyy HH:mm:ss" . can you replace your control with data bound grid in your provided example.
then implement the prepareview as following
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 2)
{
e.Style.Format = "MM/dd/yyyy HH:mm:ss ";
}
}

David



>Hi David,

Thak you for your interest in Syncfusion Products.

I have tested the issue on a simple sample. But I am afraid I was not able to reproduce the issue. Please refer the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/GGCDateTimeFormattingIssue.zip

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Regards,
Jisha






Jisha Joy [Syncfusion]
Replied On October 31, 2008 10:58 AM UTC

Hi David,

Thanks you for your update.

Please try to use the below code for formatting column and let me know if this meet your requirements.

this.gridDataBoundGrid1.Binder.InternalColumns["ColumnName"].StyleInfo.Format = "MM/dd/yyyy HH:mm:ss ";

Regards,
Jisha


David Cui
Replied On October 31, 2008 05:38 PM UTC

thx, Jisha,

It works.

David

>Hi David,

Thanks you for your update.

Please try to use the below code for formatting column and let me know if this meet your requirements.

this.gridDataBoundGrid1.Binder.InternalColumns["ColumnName"].StyleInfo.Format = "MM/dd/yyyy HH:mm:ss ";

Regards,
Jisha




Jisha Joy [Syncfusion]
Replied On November 6, 2008 09:28 AM UTC

Hi David,

Thank you for your update.

Jisha


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

;