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
165
UltraGridCell Formatting
posted

I am trying to format a cell with numbers to "###,###,###,###.##"

The number e.g. 335249560533 should display as 3352-4956 053-3

Using the format string "###,###,###,###.##" with MaskedEdit control works fine.

Can you give me a hint on how to this in WinGrid?

rgds

Wolfgang

Parents
No Data
Reply
  • 34850
    Offline posted

    Hello Wolfgang,

    In order to format a cell in the UltraGrid, you can set the Format property on the UltraGridColumn. This is best done within the InitializeLayout event of the UltraGrid, which should be hooked before you set the DataSource on the grid. Once you have that, you can set your format string to the Format property like so:

            private void UltraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridColumn column = e.Layout.Bands[0].Columns["Number"];                        
                column.Format = "###,###,###,###.##";
            }

    Please let me know if you have any other questions or concerns on this matter.

Children