简体   繁体   English

组合框的值项目(复选框)的检查状态为中性,如何更正?

[英]combobox's value item(checkbox) checkstate is neutral,how to correct it?

I am using component one's C1Combobox for filling products. 我正在使用组件的C1Combobox填充产品。 This ComboBox contains 3 columns namely productid , product , select . 该ComboBox包含3列,即productidproductselect The select column contains value item checkbox which is used to select products. select列包含用于选择产品的value item checkbox

My problem is after filling this combobox, (the valueitem ie) checkbox select state is neutral. 我的问题是填写此组合框后,(即valueitemcheckbox选择状态为中性。

How can i change the checkbox to uncheck immediately after filling the combobox 填充combobox后,如何更改checkbox以立即uncheck

this is my code to fill combo 这是我的代码来填充组合

Private Sub fillcboProducts()
    Dim dt As New DataTable
    Dim strQry As String
    Try
        strQry = "select productid,product, '' as select from gtab04 "
        Dim da As NpgsqlDataAdapter = New NpgsqlDataAdapter(strQry, GenConnection)
        da.Fill(dt)
        If dt.Rows.Count > 0 Then
            cboProducts.DataSource = dt
            cboProducts.Columns(2).ValueItems.Presentation = C1.Win.C1List.PresentationEnum.CheckBox
            cboProducts.Splits(0).DisplayColumns(0).Visible = False
            cboProducts.Splits(0).DisplayColumns("product").Width = 408
            cboProducts.Splits(0).DisplayColumns("select").Width = 10
            cboProducts.Columns("select").Caption = ""
            cboProducts.Columns("product").Caption = "Product(s)"
            setCheckBox()
        Else
            GoTo quit
        End If
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Information, "fillcboProducts")
    End Try
quit:
End Sub

and this is my output 这是我的输出

Please refer this : 请参考这个

EDIT What I understood from your requirements is that you want to uncheck all the checkboxes once the combobox is filled with items. 编辑我从您的要求中了解到,一旦组合框充满了项目,您想取消选中所有复选框。

Please note, this behavior is concurrent with windows. 请注意,此行为与Windows并发。 One has to manually uncheck all the checkboxes. 必须手动取消选中所有复选框。 However, if you wish to do it automatically, you can call a method which would separately uncheck all the checkboxes on button click. 但是,如果您希望自动执行此操作,则可以调用一个方法,该方法将单独取消选中按钮单击时的所有复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM