您好,我的代码示例是:
/* bdEmpresa(绑定(bind)源) 包含:
从 Empresa 中选择 idEmpresa、Nombre、Acceso
结果
1、Empresa1、true
2、Empresa2、假
3、Empresa2、true
*/
clEmpresas.DataSource = bdEmpresa
clEmpresas.DisplayMember = ? (名称)
clEmpresas.ValueMember = ? (附件)
最佳答案
这是我们将使用的代码
With clEmpresas.Properties
If .DataSource IsNot Nothing Then .DataSource = Nothing
.DataSource = bdEmpresa
If .DataSource.rows.count = 0 Then Return Nothing 'no data to load
'get the names from the dataset, don't expect them to be specific names
.ValueMember = .DataSource.rows(0).Table.Columns(0).ColumnName
.DisplayMember = .DataSource.rows(0).Table.Columns(1).ColumnName
'Set the selected items, comma separated list of ids
If selectedIds <> "" Then
For i As Integer = 0 To .ItemCount - 1
If Array.IndexOf(selectedIds.Split(","), .GetItemValue(i).ToString) >= 0 Then
.SetItemChecked(i, True)
End If
Next
End If
End With
关于c - 在 DevExpress vb.net 中使用 CheckBoxList 分配和评估?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45174015/