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
290
Quantity cell has different decimal places in different rows
posted

What I want to do: Each row is a different item which has a different decimal place on the quantity value.  On row initialize I want to set that row's quantity cell to be a particular number of decimal places."QTYToTransfer"].Editor = theEditor;

Thanks

Jaydel

Parents
No Data
Reply
  • 290
    Offline posted

    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;

     

Children