Skip to main content Skip to footer

How to AutoSize a Specific Column in C1Combo

This article will focus on how to AutoSize a specific column in C1Combo within a VB.NET WinForms application.

Here is the method you would create to control this functionality:

    ''' <summary>
    ''' Autosizes the Columns of a C1Combo
    ''' </summary>
    ''' <param name="col">Index of the column to be autosized. Use -1 to resize all columns</param>
    Private Sub AutoResizeComboCol(col As Integer)

        'If specific column
        If col <> -1 Then
            C1Combo1.Splits(0).DisplayColumns(col).AutoSize()
            Return
        End If

        'If all columns
        For index = 0 To C1Combo1.Splits(0).DisplayColumns.Count - 1
            C1Combo1.Splits(0).DisplayColumns(index).AutoSize()
        Next

    End Sub

 

Hunter Haaf