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

DateTimeEdit Cell Type

Thread ID:

Created:

Updated:

Platform:

Replies:

82276 Jun 8,2009 02:30 PM UTC Jun 11,2009 09:15 AM UTC WPF 5
loading
Tags: GridControl
Andrew Snyder
Asked On June 8, 2009 02:30 PM UTC

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 09:40 AM UTC

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 12:48 PM UTC

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 12:19 PM UTC

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 01:41 PM UTC

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 09:15 AM UTC

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.

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

;