Ticket T409930
Visible to All Users

How to support the ImmediatePostData attribute in a custom PropertyEditor

created 9 years ago

[DevExpress Support Team: CLONED FROM T404423: ASPxTextBox - How to dynamically change the currency mask based on the selected culture]
Thanks for your assistance so far, Lex.

I found that ImmediatePostData is not working when this property editor is used. So I called WriteValue method in TextChangedEvent. And TextChangedEvent was  fired only after setting AutoPostBack to true. After these changes, every time i change the amount, i get a dialogue 'Leave/Stay' when the page is being refreshed. Is there a way for avoiding this dialogue? Or the changes that I have done is it correct to achieve immediatePostData working?

C#
protected override WebControl CreateEditModeControlCore() { DecimalPropertyEditor = new ASPxTextBox(); DecimalPropertyEditor.AutoPostBack = true; DecimalPropertyEditor.ID = "CustomDecimalPropertyEditorWeb"; DecimalPropertyEditor.ValueChanged += DecimalProperty_ValueChanged; DecimalPropertyEditor.TextChanged += DecimalPropertyEditor_TextChanged; void DecimalPropertyEditor_TextChanged(object sender, EventArgs e) { EditValueChangedHandler(sender, e); WriteValue(); }

Thanks.

Comments (1)
DevExpress Support Team 9 years ago

    Hello Kanagu,

    I need additional time to research this issue. Please bear with us, I will get back to you as soon as possible.

    Answers approved by DevExpress Support

    created 9 years ago (modified 9 years ago)

    Hello Kanagu,

    Thank you for your patience.

    >> I found that ImmediatePostData is not working when this property editor is used.

    This is because your editors are inherited from the WebPropertyEditor class. I suggest that you change the base class to ASPxPropertyEditor. This editor supports the ImmediatePostData feature out of the box, and you will not need to write any additional code.

    >> every time i change the amount, i get a dialogue 'Leave/Stay' when the page is being refreshed

    Currently, automatic saving of user changes is not supported out of the box. The user has to click the Save button before refreshing the page.

      Comments (1)
      KD KD
      Kanagu Duraiswamy 9 years ago

        Thank you, Uriah. I changed the base class to ASPxPropertyEditor and it is fine now.

        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.