Ticket Q386658
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Usability - Make it possible to hide Clear Action via the application model

Remove Clear Button for Required Field

created 13 years ago

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.

Answers approved by DevExpress Support

created 13 years ago (modified 8 years ago)

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.

    Show previous comments (5)
    Dennis Garavsky (DevExpress) 13 years ago

      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.

        Dennis Garavsky (DevExpress) 13 years ago

          Thank you for informing us of your results, Miles!
          Regards,
          Dennis
          P.S.
          5 days of expert eXpressApp Framework (XAF) training is now available!

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.