I need CheckBox in RibbonControl and if it checked I need to perform some task if not checked I need to perform some other task. So I tried barCheckItem1
It is working properly what I expect but it is Displaying like Button I need exact CheckBox. So again I used barEditItem1
in this Item "CheckChanged" event is not available then if i write code in "EditValueChanged" event, if I check or Uncheck the event not fired. How to complete my task ?
I need CheckBox with CheckedChanged Event.
How to work with BarEditItem and BarCheckItem in RibbonControl Winforms Devexpress ?
5.4k views Asked by Srihari At
2
There are 2 answers
2
On
Is this what you need?
Add a BarEditItem
with CheckEdit
, attach event CheckedChanged
of RepositoryItemCheckEdit
. You're done.
private void repositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e)
{
Console.WriteLine(((CheckEdit) sender).Checked);
}
private void button1_Click(object sender, EventArgs e)
{
bool? ischecked = (bool?)barEditItem1.EditValue;
if(!ischecked.HasValue)
{
//In determinate state
}
else
{
if(ischecked.Value)
{
//Checked
}
else
{
//Not Checked
}
}
}
You have two ways to access the control itself:
One way is:
The other is the repository editor directly:
I hope this is helpful.