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
1825
Strange one! DropDownList combo selection checkboxes?
posted

Good morning,

I have two cells that have to be setup with a dropdown list of items with the checkbox selection feature.

To allow user to make multiple selections for the item.

It appears to work great. Both have their selection lists and the checkboxes next to them.

The thing is the first list only shows one item, the first in the checked off list, as checked off.

Even though the items appear in the list as checked off.

The second list works perfectly fine and shows the number of items checked off.

Both use the same code to set themselves up and to read back what was selected.

So why does the first one only show one item checked off when there is more then one actually checked off?

Hope that explains things. Code below.

Under the grids InitializeRow sub:

 objDDL = objTools.DBuwEdComboInit(objDDL, (strSQLIs), strWhoAmI, msUserName, strConnStrToUse)

Dim objTool As Infragistics.Win.UltraWinToolbars.ComboBoxTool
objTool = uwTBMgr.Ribbon.Tabs("Home").Groups("Home - Available Reports").Tools("Reports")
Select Case objTool.Text
    Case "Order List Details"
         With objDDL
                .AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest
                .SortStyle = Infragistics.Win.ValueListSortStyle.Ascending
                .DropDownStyle = Infragistics.Win.DropDownStyle.DropDown
                Dim intVisItemcount As Integer = objDDL.Items.Count
                If (intVisItemcount > 100) Then
                 intVisItemcount = 100
                End If
               .MaxDropDownItems = intVisItemcount
               .CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox
         End With                             
     Case Else
 End Select 
 e.Row.Cells("Value/Choices").EditorComponent = objDDL

And when I am reading back the items checked off,

-- 2nd Cell read back, on the next row
Dim intItemsSelected As Integer = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems.Count
If (intItemsSelected > 0) Then
    Dim intItemsIDX As Integer = 0
    While (intItemsIDX < intItemsSelected)
        strItemIs = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems(intItemsIDX).DisplayText
        msFilters(3) = msFilters(3) & "''" & strItemIs & "'', "
        intItemsIDX += 1
    End While
    'check for last COMA
    strItemIs = msFilters(3)
    strItemIs = StrReverse(StrReverse(strItemIs).Substring(2, (StrReverse(strItemIs).Length - 2)))
    msFilters(3) = strItemIs
Else
    msFilters(3) = .Rows(intFilterOn).Cells("Value/Choices").Text
    Select Case msFilters(3)
        Case "", "--- Choose One ---"
            msFilters(3) = ""
        Case Else
            msFilters(3) = " ''" & msFilters(3) & "'' "
    End Select
End If