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
1330
Changing column formatting in code.
posted

Hello, in the DataGridView in .Net you cna change the cell value alignment to CENTER RIGHT and the FORMATTING to CURRENCY.

 

I need to be able to do this in code for the UltraGrid but I cannot figure out how to do so.  

 

Anyone know how to do this?

  • 469350
    Offline posted


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

                band.Columns["String 1"].CellAppearance.TextHAlign = HAlign.Right;
                band.Columns["String 1"].CellAppearance.TextVAlign = VAlign.Middle;
                band.Columns["String 1"].Format = "c";                
            }