开发者

How to set checkstate of particular item in repositoryItemCheckedComboBoxEdit which is bound to datasource?

I'm having repositoryItemCheckedComboBoxEdit which is placed in BarEditItem. I want to bind a datasource to the repositoryItemCheckedComboBoxEdit.

For that I used the datasource property of repositoryItemCheckedComboBoxEdit. But I'm unable to set the checkstate to checked or unchecked in the datasource for each item in datasourc开发者_如何学编程e. How do I solve this problem?


What datasoource are you binding to? Some code will be helpful. Here is an idea

// Add check items to the control's dropdown.
string[] itemValues = new string[] { 
    "Circle", "Rectangle", "Ellipse", 
    "Triangle", "Square" };
foreach (string value in itemValues)
    checkedComboBoxEdit1.Properties.Items.Add(value, CheckState.Unchecked, true);
// Specify the separator character.
checkedComboBoxEdit1.Properties.SeparatorChar = ';';
// Set the edit value.
checkedComboBoxEdit1.SetEditValue("Circle; Ellipse");
// Disable the Circle item.
checkedComboBoxEdit1.Properties.Items["Circle"].Enabled = false;

RepositoryItemCheckedComboBoxEdit.Items Property

Basically you need to set the SetEditValue

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜