I have a UltraComboEditor with the following settings:
cboConnections.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox cboConnections.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleLeft cboConnections.SortStyle = Infragistics.Win.ValueListSortStyle.Ascending
As data source I use a regular DataTable.
I initiate the datatable with this code:
Dim col1 As New DataColumn("Id", GetType(String)) Dim col2 As New DataColumn("Desc", GetType(String)) Dim col3 As New DataColumn("ProtocolType", GetType(ConnectionClass.ProtocolT)) Dim col4 As New DataColumn("SortDesc", GetType(String)) DTConnections.Columns.Add(col1) DTConnections.Columns.Add(col2) DTConnections.Columns.Add(col3) DTConnections.Columns.Add(col4) Dim primarykey(0) As DataColumn primarykey(0) = col1 DTConnections.PrimaryKey = primarykey cboConnections.DataSource = DTConnections
I am able to succefully check the checkboxes I want to check with this method:
Friend Sub SetConnectionIds(l As List(Of String)) For Each item As Infragistics.Win.ValueListItem In cboConnections.Items Dim drow As DataRowView = CType(item.ListObject, DataRowView) If l.Contains(item.DataValue.ToString) Then item.CheckState = CheckState.Checked Else item.CheckState = CheckState.Unchecked End If Next If cboConnections.Items.Count > 0 Then cboConnections.SelectedIndex = 0 End If End Sub
The problem is the last part where I want to show (at least 1) row. I have tried setting SelectedIndex, SelectedItem and Value but all results in that the combo is empty. The right ones are checked in combo but nothing is selected which results in that I cannot get a quick overview if anything is checked at all. How can I solve this. I am using 14.1 version.
Hello Henrik,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Hi Henrik,
Thank you for posting in our forums.
What I could suggest in your case is to use UltraCombo instead of UltraComboEditor. The UltraCombo have a multi-select functionality with the help of which you will be able to display all selected items in the combo. For more information about this approach, pelase follow this link:
http://help.infragistics.com/Doc/WinForms/2014.2/CLR4.0/?page=WinCombo_Selecting_Multiple_Values_within_WinCombo.html
I have attached a sample which demonstrates this suggestion.
Please let me know if you have any additional questions.