BUG: CheckedListBox Control Loses Check Marks When the Visible Property Is Changed to FALSE and Then Back to TRUE (327896)
The information in this article applies to:
- Microsoft Common Language Runtime (included with the .NET Framework) 1.0
This article was previously published under Q327896 SYMPTOMS Check marks are cleared when the visibility of a CheckedListBox control changes. This only occurs when the control is data-bound.
CAUSE This problem occurs because the CheckedListBox was not designed for data binding. RESOLUTION You can populate the CheckedListBox manually. You must not use data binding with the CheckedListBox.
Dim DataTbl As New DataTable("DemoTable")
Dim DataCol1 As New DataColumn()
Dim DRow As DataRow
Dim counter As Int32
DataCol1.DataType = GetType(String)
DataCol1.ColumnName = "Name"
DataTbl.Columns.Add(DataCol1)
For counter = 0 To 10
DRow = DataTbl.NewRow()
DRow("Name") = "John " & counter.ToString
DataTbl.Rows.Add(DRow)
Next
Dim sqlDS As New DataSet()
sqlDS.Tables.Add(DataTbl)
For Each DRow In sqlDS.Tables("DemoTable").Rows
Me.CheckedListBox1.Items.Add(DRow("Name"))
Next
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 9/4/2003 |
---|
Keywords: | kbbug KB327896 kbAudDeveloper |
---|
|