I am calling IntializeLayout on my EpiUltraGrid to customize the grid headers, order and width. This worked fine in version 10.1.500, after upgrading to 10.2.300 this no longer works. Debugging in Visual Studio, I see the code does get called, but it either doesn’t take or is overridden by the default layout. Any ideas?
private void UGChangeLog_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
// ** Place Event Handling Code Here **
Infragistics.Win.UltraWinGrid.UltraGridLayout layout = args.Layout;
Infragistics.Win.UltraWinGrid.UltraGridBand band = layout.Bands[0];
band.Columns["Date01"].Header.Caption = "Change Date";
band.Columns["Number01"].Header.Caption = "Amount";
band.Columns["Number02"].Header.Caption = "Line #";
band.Columns["Character01"].Header.Caption = "Description";
band.Columns["Character10"].Header.Caption = "Changed By";
band.Columns["Number01"].Format = "#,##0";
band.Columns["Number02"].Format = "#,##0";
band.Columns["Date01"].Width = 90;
band.Columns["Number01"].Width =120;
band.Columns["Number02"].Width = 40;
band.Columns["Character01"].Width = 300;
band.Columns["Character10"].Width = 120;
band.Columns["Date01"].Header.VisiblePosition = 1;
band.Columns["Number01"].Header.VisiblePosition = 2;
band.Columns["Number02"].Header.VisiblePosition = 3;
band.Columns["Character01"].Header.VisiblePosition = 4;
band.Columns["Character10"].Header.VisiblePosition = 5;
band.Columns["Number01"].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;
band.Columns["Number02"].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right;
}
In addition using Extended Properties which will change the Titles/Visibility for you…