Hi,
I tried to show mm/yyyy on gridview with the code
I tried to show mm/yyyy on gridview with the code
CultureInfo
cultureInfo = new CultureInfo("en-US");
DateTimeFormatInfo dateInfo = new DateTimeFormatInfo();
dateInfo.ShortDatePattern =
"MM/yyyy";
cultureInfo.DateTimeFormat = dateInfo;
Style datePickerStyle = new Style(typeof(RadDatePicker));
datePickerStyle.Setters.Add(
new Setter(RadDatePicker.CultureProperty, cultureInfo));
datePickerEditorSettings.CellEditStyle = datePickerStyle;
((
GridViewDataColumn)this.radGridViewData.Columns[1]).EditorSettings = datePickerEditorSettings;
It crashes, but if I change MM/yyyy to MM/dd/yyyy, the cells shows MM/dd/yyyy 12:00 AM.
Thanks so much for any help.