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
100
Paloma. Dude with my rowLayout
posted

Hello!, My code is the following one:

 

Private Sub Pro_Configura_ugdProyecto(ByVal pTabla_Grid As DataTable)

   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

'------------------------------------------

Dim rowLayout1 As Infragistics.Win.UltraWinGrid.RowLayout = band.RowLayouts.Add("RowLayout1")

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

And my  

Pro_Formato_ugdProyectos()

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()

End Sub

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

  • 469350
    Offline posted

    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.