Mahmood Jenami
Mahmood Jenami

Reputation: 431

Set DisplayFormat and EditFormat for DevExpress TextEdit

I have a DevExpress TextEdit with following properties:

    this.txtPrice.EditValue = "";
    this.txtPrice.Location = new System.Drawing.Point(677, 73);
    this.txtPrice.Name = "txtPrice";
    this.txtPrice.Properties.Appearance.Font = new System.Drawing.Font("B Mitra", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178)));
    this.txtPrice.Properties.Appearance.Options.UseFont = true;
    this.txtPrice.Properties.DisplayFormat.FormatString = "f0";
    this.txtPrice.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
    this.txtPrice.Properties.Mask.BeepOnError = true;
    this.txtPrice.Properties.Mask.EditMask = "999999999999";
    this.txtPrice.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Simple;
    this.txtPrice.Size = new System.Drawing.Size(124, 24);
    this.txtPrice.TabIndex = 4;
    this.txtPrice.TextChanged += new System.EventHandler(this.txtPayed_TextChanged);

I want to set a display and edit Format (just a thousand separator) for it i have tested "N0" and "f0" and set formatType to numeric but nothing happened. please tell me how to apply thousand separator to it.

Upvotes: 0

Views: 3358

Answers (1)

Anubis77
Anubis77

Reputation: 142

enter image description here

Go to the properties property of the dexexpress text-edit, and set masktype to numeric. Then set the Mask to ",#######". This displays the thousands separator without any decimals. I have tested it and it works.

Upvotes: 2

Related Questions