Thanks
Jaydel
private void mBOM50206UG_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { //Create the Settings Object: DefaultEditorOwnerSettings theSettings = new DefaultEditorOwnerSettings();
//as well as the Editor Owner: DefaultEditorOwner theOwner = new DefaultEditorOwner(theSettings);
EmbeddableEditorBase theEditor = null;
object theValue = e.Row.Cells["QTYToTransfer"].Value;
//Create an appropriate editor based on the //Value's Data Type: if (theValue is decimal) { theSettings.DataType = typeof(decimal); //theSettings.Format = "n2"; theSettings.MaskInput = "nnn,nnn,nnn,nnn.nnnnn"; theEditor = new EditorWithMask(theOwner); }
//Assign it to the Cell.Editor e.Row.Cells["QTYToTransfer"].Editor = theEditor;
Hi,
Your code here can be made much simpler. You don't need a DefaultEditorOwner. The EditorWithMask already has a MaskInput property you can set directly.
So all you have to do is create a new EditorWithMask and set the MaskInput on it, then assign it to the cell.
The only other thing you have to do is tell the grid column to use the mask settings of the editor before it looks at the properties of the column itself. You do that by setting UseEditorMaskSettings on the column to true.