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
295
How to allow entering of decimal input prefixed with $ symbol in front
posted

I want a decimal input column in wingrid prefixed with $ symbol. 

Please find the below picture for reference

Parents
  • 469350
    Offline posted

    Hi,

    You can do with using the Format property on the column. Assuming that the DataType of the column is a numeric type, like decimal / currency, you could do something as simple as this:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band = layout.Bands[0];

                band.Columns["Decimal 1"].Format = "c";           
            } 

    The "c" format will format the value as currency using the current system settings. For other number format options, check out Microsoft's documentation:

    Standard Numeric Format Strings

    Custom Numeric Format Strings

Reply Children