This is in version 9.2. I'm setting the EditorControl for numeric columns in a grid. I'm also programatically changing the FormatInfo on the EditorControl so that DecimalSeparator=comma and GroupSeparator=period. I'm not changing the regional settings in Windows though.
This works fine in the control outside of the grid, but the grid column always uses the current regional settings for the separators (opposite of what I'm trying to set)
This is what I'm doing in my InitializeLayout event. I think it used to work correctly:
col.EditorControl = ((NumericTextBox)c);col.PromptChar = ' ';col.CellAppearance.TextHAlign = HAlign.Right;col.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
// I've tried adding combinations of the following properties, but there is no// change in behavior
col.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double;col.MaskInput= "{double:-16.5}";col.FormatInfo=((NumericTextBox)c).FormatProvider; // Looking at this in the debugger, it shows what I want, but the grid does not display what I want.
Format is never applied when in edit mode. Format only works when a cell is not in edit mode. You cannot format data while it's being edited.
For edit mode, you might want to use MaskInput on the column to create an input mask.
Or, if that won't do what you need, you could use a CreationFilter to format the data yourself - but you would have to handle both EditorToDisplay and DisplayToEditor and both format and un-format the data.
Unfortunately setting the Format and FormatInfo is not working (in edit mode).
col.Format = "N10";
col.FormatInfo=((NumericTextBox)c).FormatProvider;
The Format and FormatInfo are working when the cell is not in edit mode. However, when in edit mode the FormatInfo seems to be defaulting to the current culture settings instead of the FormatInfo of the grid column or editor control (they are the same)
The grid doesn't use the actual Control. The control simply provides a copy of it's own editor for use in the grid. So there are many control-level properties that will not affect the grid.
If you want to change the FormatInfo on a grid column, you need to set the FormatInfo on the column itself. Setting it on the EditorControl will have no effect.
If setting FormatInfo on the column is not working, either, then something else is wrong. I think, perhaps, that FormatInfo does not get called unless there is also a Format applied to the column. So try setting the Format on the column, as well, and see if that helps.