express| Control | display
DevExpress's controls are pretty good and useful, but Dateedit can only display a "star" word when the week name is displayed.
Here's the workaround, which eliminates the need to modify its source code, so it's not necessary to recompile and use its published standard DLL directly.
public class MyDateEdit:DevExpress.XtraEditors.DateEdit
{
protected override DevExpress.XtraEditors.Popup.PopupBaseForm Createpopupform ()
{
Return to New Mypopupdateeditform (this);
}
}
public class MyPopupDateEditForm:DevExpress.XtraEditors.Popup.PopupDateEditForm
{
Public Mypopupdateeditform (Mydateedit dateedit): Base (Dateedit)
{
}
protected override DevExpress.XtraEditors.Controls.DateEditCalendar Createcalendar ()
{
return new Mydateeditcalendar (Owneredit.properties, Owneredit.editvalue);
}
}
public class MyDateEditCalendar:DevExpress.XtraEditors.Controls.DateEditCalendar
{
Public Mydateeditcalendar (
DevExpress.XtraEditors.Repository.RepositoryItemDateEdit Item,
Object editdate): Base (item, Editdate)
{
}
protected override DevExpress.XtraEditors.ViewInfo.DateEditInfoArgs Createinfoargs ()
{
devexpress.xtraeditors.viewinfo.dateeditinfoargs info = base. Createinfoargs ();
system.globalization.datetimeformatinfo Newformat =
(System.Globalization.DateTimeFormatInfo) info. Dateformat.clone ();
//The following is the week name for the reset date.
//By default, preceded by the word "Week", it is because of this that causes the so-called error.
// Note that the current implementation of the unhandled locale is only applicable to the Chinese environment. &NBSP
newformat.abbreviateddaynames = new string[]{
"Day",
"A",
"Two",
"Three",
"Four",
"Five",
"VI"};
Info. DateFormat = Newformat;
return info;
}
}
When you use it, just mydateedit dateEdit1 = new Mydateedit () is OK.