如何检查 radComboboxItem 'CheckBox'?

Meh*_*ard 1 c# checkbox telerik radcombobox

我对图书馆“Telerik”有一点问题。事实上,我想实现一个带有'checkBox'的'RadCombobox'。它运行良好,但是当我想要'Check'一个项目时,这是不可能的?!这是我的示例代码。我更改了属性'selected'的属性但是不幸的是,它没有选中“已选中”框.....

非常感谢您的回答!

<!-- language: lang-cs -->

//Define the sqlAdaptater for binding source

System.Data.SqlClient.SqlDataAdapter myBinding = new SqlDataAdapter("SELECT [name] FROM [dbo].[tblProcess] WHERE [currentVersion] = 1 AND [deleted] = 0 AND [parent] = 0",connectionString);

DataTable links = new DataTable();

myBinding.Fill(links);

//Set the attributs of RadCombobBox

RadComboBoxSelectedEntity.DataTextField = "name";
RadComboBoxSelectedEntity.DataValueField = "name";
RadComboBoxSelectedEntity.DataSource = links;

//Not working..its selected but not checked ?
RadComboBoxSelectedEntity.SelectedIndex = 1;

//Not exist ?? -> 
RadComboBoxSelectedEntity.CheckedIndex = 1;
Run Code Online (Sandbox Code Playgroud)

Cla*_*edi 5

尝试调用方法DataBind第一

RadComboBoxSelectedEntity.DataBind();
Run Code Online (Sandbox Code Playgroud)

调用后,DataBind您可以尝试这行代码仍然无法正常工作,

RadComboBoxSelectedEntity.Items[1].Checked = true;
Run Code Online (Sandbox Code Playgroud)