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

  • 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;

     

  • 469350
    Suggested Answer
    Offline posted

    I'm not sure why it's not working for you, but the code you posted here is unreadable. Can you post it again and surround it with a 'code' tag? Or copy the code into notepad and then copy and paste it from there, so it doesn't get formatted.