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
5250
ultraCombo DropDown Layout
posted

Hi all

I am trying to build a very simple ultraCombo.
I have a DataTable with some string entries.
I have set DataSource = DataTable.
Now, the DropDown has a header and also the size (width)
does not fit with the ultraCombo control.

How can I do this ?
Just set the dataSource and when the user clicks on the button
the dropDown should be just a list of entries and the width should
be the same width als the ultraCombo.

Thanks and best regards
Frank Uray

I have tried the following:

                this.ultraCombo_ConnectionA_Source_Server.DataSource = GetSQLServers();
                this.ultraCombo_ConnectionA_Source_Server.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDown;
                this.ultraCombo_ConnectionA_Source_Server.DropDownWidth = this.ultraCombo_ConnectionA_Source_Server.Width;
                this.ultraCombo_ConnectionA_Source_Server.DisplayLayout.UseFixedHeaders = false;
                this.ultraCombo_ConnectionA_Source_Server.DisplayLayout.Override.ColumnAutoSizeMode = Infragistics.Win.UltraWinGrid.ColumnAutoSizeMode.AllRowsInBand;

 

  • 445
    Suggested Answer
    Offline posted

    I have a routine I use to do this repetitive task. It takes into account if the width of the text displayed in the drop down as well as one or two columns.

     

        Public Sub SetDropDownWidth(ByRef oCombo As Infragistics.Win.UltraWinGrid.UltraCombo, ByVal ColumnName As String, Optional ByVal ColumnName2 As String = Nothing)
            Try
                oCombo.DisplayLayout.Bands(0).Columns(ColumnName).Width = oCombo.DisplayLayout.Bands(0).Columns(ColumnName).CalculateAutoResizeWidth(Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand, True)
                If ColumnName2 IsNot Nothing Then
                    oCombo.DisplayLayout.Bands(0).Columns(ColumnName2).Width = oCombo.DisplayLayout.Bands(0).Columns(ColumnName2).CalculateAutoResizeWidth(Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand, True)
                End If
                If oCombo.DisplayLayout.Bands(0).Columns(ColumnName).Width < oCombo.Width Then
                    If ColumnName2 IsNot Nothing Then
                        oCombo.DisplayLayout.Bands(0).Columns(ColumnName).Width = oCombo.Width * 0.7
                        oCombo.DisplayLayout.Bands(0).Columns(ColumnName2).Width = oCombo.Width * 0.3
                    Else
                        oCombo.DisplayLayout.Bands(0).Columns(ColumnName).Width = oCombo.Width
                    End If
                End If
            Catch ex As Exception
                HandleError(ex, "modControlLayout", "SetDropDownWidth")
            End Try

        End Sub

  • 5250
    Offline posted

    I have got it: I use UltraCombo Editor now :-)