I'm trying to remove the clear button on a referenced object field because it is a required property (similar to http://www.devexpress.com/issue=Q290546), but I can't seem to find how to do this.
I keep finding references to K18055, but it can't figure out which controller to use to get the action. I've also seen references to AQ16459, but other articles say this example is out of date.
Any help would be appreciated.
We have closed this ticket because another page addresses its subject:
Usability - Make it possible to hide Clear Action via the application modelRemove Clear Button for Required Field
Answers approved by DevExpress Support
To hide the Clear button in the LookupPropertyEditor, set the IModelCommonMemberViewItem.AllowClear property of a corresponding member to false using the Model Editor. Refer to the following ticket for more details: Usability - Make it possible to hide Clear Action via the application model.
Hi,
I apologize. My previous answer was inaccurate because the Frame property is lazy. You can use the following code to access it:
C#public class MyClass : ViewController<DetailView> {
private LookupPropertyEditor editor;
protected override void OnActivated() {
base.OnActivated();
editor = (LookupPropertyEditor)View.FindItem("Manager");
editor.ControlCreated += new EventHandler<EventArgs>(MyClass_ControlCreated);
}
void MyClass_ControlCreated(object sender, EventArgs e) {
((LookupPropertyEditor)sender).Control.Popup += new EventHandler(Control_Popup);
}
void Control_Popup(object sender, EventArgs e) {
//Dennis: Access editor.Frame here.
}
}
Thanks,
Dennis
P.S.
5 days of expert eXpressApp Framework (XAF) training is now available!
Finally got it working for both the web and windows versions. For anyone interested, my code is attached.
Thank you for informing us of your results, Miles!
Regards,
Dennis
P.S.
5 days of expert eXpressApp Framework (XAF) training is now available!