老师,求教下,以下代码是帮助文件,请问, 我如果不是自定义项目列表,而是固定数据表绑定,代码该如何改,当前代码执行后报错:“从类型“DataRowView”到类型“String”的转换无效。”
Dim ckl As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim nms As New List(of String)
For i As Integer = 0 To ckl.Items.count - 1 '获取已经勾选的列
If ckl.GetItemChecked(i) Then
nms.Add(ckl.Items(i))
End If
Next
If nms.Count = 0 Then
MessageBox.Show("至少要选择一列","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If