Question

I got form with GridLookUpEdit. DisplayMember type is DateTime. So I set GridLookUpEdit FormatType to DateTime and FormatString to "d". But when I select row in GridLookUpEdit, selected value is displayed with zero-time, like 15.04.2014 0:00:00. How can I avoid this thing?

Was it helpful?

Solution

When you select a particular cell and if the cell is set to Editable then the cell's editor is shown. To use a particular cell editor, you have to add these lines of code :

// aDateColumn is the column you want to format
// Custom mask
RepositoryItemTextEdit columnEdit = new RepositoryItemTextEdit();
columnEdit.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
columnEdit.Mask.EditMask = "d";

aDateColumn.ColumnEdit = columnEdit;

More info here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top