English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Date Row Display Format Setting of C# DevExpress gridcontrol

As shown in the figure above, the date is displayed as "MM month DD day", or other formats, such as displaying year, month, day, or year-month-day with time, the setting is as follows:

1As shown in the figure below, the date is d, and the time is t:

2In the event, the following writing is as follows:

private void bandedGridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
    {
      // Date Display Format
      PQF31.DisplayFormat.FormatString = "MM month dd day";
      //PQF31.DisplayFormat.FormatString = "YY-MM-DD TT:HH";
    }

Set the DevExpress GridControl control to display the time column with hours, minutes, and seconds

As described, if the Dev GridControl control is bound to a DataTable data source, and one of the columns in the DataTable is of Date type, the GridControl default display style only shows the current date and does not display the hours, minutes, and seconds. As shown in the figure:

Solution:

Set the display style as shown in the figure:

The settings are complete, and the result is displayed as shown in the figure:

You May Also Like