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

DateTimeEdit Cell Type

Thread ID:

Created:

Updated:

Platform:

Replies:

82276 Jun 8,2009 10:30 AM Jun 11,2009 05:15 AM WPF 5
loading
Tags: GridControl
Andrew Snyder
Asked On June 8, 2009 10:30 AM

When using a DateTimeEdit cell is it possible to change the NoneDateText value of the DateTimeEdit control?

Similarly can you set CellValue of the cell so that it displays the NonDateText. It appears that DateTime.Today is the value when you select none in the DateTimeEdit control, but when that value it does not show "no date selected".

Is it possible to change that value also maybe to something like CultureInfo.CurrentCulture.Calendar.MaxSupportedDateTime?

void Model_CommitCellInfo(object sender, GridCommitCellInfoEventArgs e)
{
DateTime dt = Convert.ToDateTime(e.Style.CellValue);
if (dt == DateTime.Today)
{
_dataSource[e.Cell.ColumnIndex,e.Cell.RowIndex] = MyConstants.NoDateSelected;
}
else
{
_dataSource[e.Cell.ColumnIndex,e.Cell.RowIndex] = dt;
}
}

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
Model[e.Cell.RowIndex, e.Cell.ColumnIndex].CellType = "DateTimeEdit";
Model[e.Cell.RowIndex, e.Cell.ColumnIndex].DateTimeEdit.DateTimePattern = DateTimePattern.LongDate;
Model[e.Cell.RowIndex, e.Cell.ColumnIndex].CultureInfo = new CultureInfo("en-US");
if (MyConstants.NoDateSelected == _dataSource[e.Cell.ColumnIndex,e.Cell.RowIndex])
{
e.Style.CellValue = DateTime.Today;
}
else
{
e.Style.CellValue = _dataSource[e.Cell.ColumnIndex,e.Cell.RowIndex];
}
}




Mohamed Suhaib Fahad A. [Syncfusion]
Replied On June 9, 2009 05:40 AM

Hi Andrew,

Thanks for using Syncfusion products.

Currently we do not have a feature to set the NoneDateText through the GridStyleInfo, this is a feature request, and we would certainly add it up. Please create a Direct Trac incident for following up on that request.

Please let me know if you want any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

Andrew Snyder
Replied On June 9, 2009 08:48 AM

Do these questions also need to be feature requests?

Similarly can you set CellValue of the cell so that it displays the NonDateText. It appears that DateTime.Today is the value when you select none in the DateTimeEdit control, but when that value it does not show "no date selected".

Is it possible to change that value also maybe to something like CultureInfo.CurrentCulture.Calendar.MaxSupportedDateTime?

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On June 10, 2009 08:19 AM

Hi Andrew,

Yes, the NoneDateText will be the feature implementation.

For the other one, you could set the style.DateTimeEdit.MaxDate = CultureInfo.CurrentCulture.Calendar.MaxSupportedDateTime,

Please let me know if you want any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

Andrew Snyder
Replied On June 10, 2009 09:41 AM

Is there a date i need to set in order to see the nondatetext? It appears to be DateTime.Today, but that does not make the nondatetext appear?

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On June 11, 2009 05:15 AM

Hi Andrew,

Like I mentioned, currently the DateEdit control itself shows the current date and that is why the NoneDateText is not getting shown. I have already informed the Tools team to look into this. Please create a Direct Trac incident for us to notify you when this is implemented. Let me know if you want any more details on this.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

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.

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.

;