Hello!, My code is the following one:
Dim Tabla_Grid As DataTable
Tabla_Grid = pTabla_Grid.Clone
Dim band As Infragistics.Win.UltraWinGrid.UltraGridBand = ugdProyectos.DisplayLayout.Bands(Tabla_Grid.TableName)
band.Override.RowSpacingAfter = 10
band.Override.RowSelectorWidth = 10
band.UseRowLayout = True
'------------------------------------------
rowLayout1.ColumnInfos("CUENTA").Initialize(0, 0, 2, 2)
rowLayout1.ColumnInfos("RAZON").Initialize(2, 0, 2, 2)
rowLayout1.ColumnInfos("RFC").Initialize(4, 0, 2, 2)
rowLayout1.ColumnInfos("PROYECTO").Initialize(0, 2, 2, 2)
rowLayout1.ColumnInfos("FECHA_INICIO").Initialize(2, 2, 2, 2)
rowLayout1.CardView = False
rowLayout1.RowLayoutLabelStyle = Infragistics.Win.UltraWinGrid.RowLayoutLabelStyle.WithCellData
rowLayout1.RowLayoutLabelPosition = Infragistics.Win.UltraWinGrid.LabelPosition.Left
ugdProyectos.DisplayLayout.Bands(0).RowLayouts("RowLayout1").Apply()
Pro_Formato_ugdProyectos()
End Sub
ugdProyectos.DisplayLayout.Bands(0).Columns("CUENTA").PerformAutoResize()
ugdProyectos.DisplayLayout.Bands(0).Columns("RAZON").AutoSizeMode = Infragistics.Win.UltraWinGrid.ColumnAutoSizeMode.AllRowsInBand
ugdProyectos.DisplayLayout.Bands(0).Columns("RFC").PerformAutoResize()
ugdProyectos.DisplayLayout.Bands(0).Columns("PROYECTO").PerformAutoResize()
ugdProyectos.DisplayLayout.Bands(0).Columns("FECHA_INICIO").PerformAutoResize()
ugdProyectos.DisplayLayout.Bands(0).Columns("FECHA_FIN").PerformAutoResize()
My question is, when I fit the content of the columns, the width of my headers becomes big. Though it applies the code
ugdProyectos.DisplayLayout.Bands(0).Columns("CUENTA").Header.Column.PerformAutoResize()
Nothing Happens.
How I can fit the width of my Headers?
Thanks
I don't understand the question. Calling PerformAutoResize on the column sizes the column to it's contents. The code as you have it here will may work depending on what event it's in, because you are not passing in any parameters to the PerformAutoResize method. By default, it's only going to size based on the rows that have been created and if the grid hasn't painted, yet, there will be no rows. You probably want to pass in AllRowsInBand.