configure the edit mode and display the date and time

edit Mode

Date format GroupEdit in edit mode, the default cell Short. To change the date format (e.g. dd.MM.yyyy HH:mm) in a single GroupEdit should SetupEditor in the handler add the code:

if (e.control is ICSSoft.STORMNET.Windows.Forms.DateTimePicker)
    ICSSoft.STORMNET.Windows.Forms.DateTimePicker dtp=(ICSSoft.STORMNET.Windows.Forms.DateTimePicker)e.control;
    dtp.OnlyDate = false;

    dtp.Format = DateTimePickerFormat.Custom;
    dtp.CustomFormat = "dd.MM.yyyy HH:mm";

In display mode

The date format in the display mode for individual GroupEdit is set in the form designer:

			C1.Win.C1FlexGrid.C1FlexGrid flex = Tools.GetFlexGrid(this.ДвижениеОтказа);
			string attributeName = Date;			
				flex.Cols[attributeName].Style.Format = "dd.MM.yyyy"; 
				Tools.ShowWarning("Failed to set the date format attribute " + attributeName + 
							      "- it will use date format by default");

In this example, this.ДвижениеОтказа type is GroupEdit.

Переведено сервисом «Яндекс.Переводчик»