C# combobox的值项(复选框)checkstate是中性的,如何更正它?
我使用组件一的C1Combobox来填充产品。此组合框包含3列,即productid、product和select。选择列包含用于选择产品的值项复选框 我的问题是,填充此组合框后,valueitem ie复选框select状态为中性 如何在填充组合框后立即将复选框更改为取消选中 这是我填充组合的代码C# combobox的值项(复选框)checkstate是中性的,如何更正它?,c#,vb.net,componentone,C#,Vb.net,Componentone,我使用组件一的C1Combobox来填充产品。此组合框包含3列,即productid、product和select。选择列包含用于选择产品的值项复选框 我的问题是,填充此组合框后,valueitem ie复选框select状态为中性 如何在填充组合框后立即将复选框更改为取消选中 这是我填充组合的代码 Private Sub fillcboProducts() Dim dt As New DataTable Dim strQry As String Try
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
和请参考:
编辑
我从您的需求中了解到的是,一旦组合框中填充了项目,您希望取消选中所有复选框
请注意,此行为与windows并发。必须手动取消选中所有复选框。但是,如果您希望自动执行此操作,您可以调用一种方法,该方法将在单击按钮时分别取消选中所有复选框。添加一些详细信息如何,因此,如果链接损坏,此答案对未来用户有用?