Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2060
Different formatting when viewing and editing in UltraTextEditor
posted

Is it possible to use different formatting settings for the data displayed by a bound UltraTextEditor when it is being viewed and when it is being edited?

The behaviour I am particularly looking for in this instance is similar to Excel, where a number is shown with a pre-configured number of decimal places with comma separators when it isn't being edited, but switches to show all of the decimal places and no commas when the user is editing the value.

 I suppose what I really want to be able to do is to set the .Net String.Format property for the data in the control separately depending on whether the control is in View or Edit state.

I have worked through this post http://forums.infragistics.com/forums/t/6140.aspx, but like that guy I don't really want to use a masked control as I don't want a fixed number of decimal places when editing (just when viewing).  I tried the suggestion there of creating a data filter, but that only works on what is displayed when you are viewing, the mask takes over when you are editing and so you are stuck with a fixed number of decimal places again.

I suppose one option is to roll my own control based on two UltraTextEditors inside a UltraControlContainerEditor; that would allow me to use two datafilters, one for the Edit text editor and one for the view text editor, and to set the different formats for data in the text editors via those datafilters.

That might work, but it seems a long way round, is there an easier way?

 

Parents Reply Children