StrataFrame Forum

SF DevExpress TextEdit - Percent can't store value

http://forum.strataframe.net/Topic9271.aspx

By Chan - 6/3/2007

Hi,

I am using SF DevExpress textEdit, with editmask set to 'P' and masktype to numeric. When I edit value in the control and lost focus, SF Dev Textedit doesn't store my value. It reverted back to previous value.

I did try to use DevExpress textedit directly, and it works without problem.

Do you think it is a bug in SF.NET?

Thank you

By StrataFrame Team - 6/4/2007

What is the BindingProperty on the textbox?  If it's Text, then it could be that the value in the textbox cannot be converted into the data type to which the control is bound.  (i.e.: if the value in the textbox is 1,000 it cannot be converted to a System.Int32 because of the comma).
By dgsoft - 1/24/2010

I have absolutely the same problem. The value is revert (set of bo property does not happens)



Me.Properties.Mask.EditMask = "P0"

Me.Properties.Mask.MaskType = Mask.MaskType.Numeric

Me.Properties.DisplayFormat.FormatString = "P0"

Me.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric

Me.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far

Me.Properties.Mask.UseMaskAsDisplayFormat = True



What is solution for this problem?
By dgsoft - 1/25/2010

Ok. answer found by my own
By Edhy Rijo - 1/26/2010

dgsoft (01/26/2010)
Ok. answer found by my own




Would you mind posting the answer? Cool
By dgsoft - 1/27/2010

Hi,

As Ben Chase wrote before the problem happens because as default BindingProperty set to "Text", but for correct work it must be set to "EditValue"

Here is a code what made good percent textbox ready Smile



' DataSource Part

Me.textbox.BindingField = "manufacturer_mwst"

' BindingProperty is important!

Me.textbox.BindingProperty = "EditValue"

Me.textbox.BusinessObject = Me.Bbay_manufacturerBO1

Me.textbox.BusinessObjectEvaluated = True



' Mask Part

Me.textbox.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far

Me.textbox.Properties.Mask.EditMask = "P0"

Me.textbox.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric

Me.textbox.Properties.Mask.UseMaskAsDisplayFormat = True



Denis
By Edhy Rijo - 1/28/2010

Thanks Denis.