I am using a Ribbon Control with a Ribbon Page Group. Inside the group I added a Bar Edit Item that is setup as a Radio Group. I am trying the have the user choose one of the radio group options and then the rest of the form will change in appearance based of the user option. The "EditValueChanged" event is not firing until I click on another part of the form. I realize that there is a "ItemPress" event that fires immediately, however, the value of the "EditValue" property still has not changed and does not change until I intentionally lose focus of the radio group
Edit Value Changed is not firing until focus is lost
Answers
Hi John,
Thank you for contacting us. BarEditItem.EditValue is changed when an editor should be hidden.You can post the editor's value manually via the RibbonControl.Manager.ActiveEditItemLink.PostEditor method.
C#private void repositoryItemRadioGroup1_EditValueChanged(object sender, EventArgs e)
{
ribbon.Manager.ActiveEditItemLink.PostEditor();
}
Thanks,
John.
John,
Thanks for replying. I may have not made my question clear. The EditValueChanged is not firing so it will not help me to place a call to PostEditor in an event that does not fire unless I intentionally lose focus of the control. If EditValueChanged was firing I would not have this issue. I did try the PostEditor call in the ItemPress event but it is still not changing the EditValue of the control. Just to be clear on what I need. I have a radio group. When the user clicks on one of the options, I want to bring a panel to the front and send the other panel to the back changing the look of the interface. The edit values of the two radio group options are true and false but when I click on one of the options the only event firing is the ItemPress event. The EditValueChanged event does not fire unless I click on some other control. Whats really frustrating is that the actual editValue property is not registering the change. Thanks so much for your efforts on this matter!
private void rbEncoding_ItemPress(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
ribbonControl1.Manager.ActiveEditItemLink.PostEditor();
if ((Boolean)rbEncoding.EditValue == true)
{
gbxADI.BringToFront();
gbxSpec2000.Visible = true;
epc = "urn:epc:tag:adi-var:";
lblEPC.Text = epc;
}
else
{
gbxSGTIN96.BringToFront();
gbxSpec2000.Visible = false;
epc = "urn:epc:tag:sgtin-96:";
lblEPC.Text = epc;
}
}
Hi John,
To catch the moment when an edit value is changed, you need to handle the RepositoryItemRadioGroup.EditValueChanged event, not the BarEditItem.EditValueChanged event. The RepositoryItemRadioGroup.EditValueChanged event is raised immediately after an edit value is changed. If you with to access this value, simply cast a sender to the RadioGroup type and use the RadioGroup.EditValue property.
Please let me know if you need any further assistance.
Thanks,
Svetlana