Ticket Q550121
Visible to All Users

Problem with NullString on ButtonEdit added on tdxBar

created 11 years ago

Hallo

I have a problem with NullString on ButtonEdit which added to tdxBar.

try run sample app on bar is added TcxBarEditItem as tcxButtonEdit. You can see nullstring.
1 . Type some text and exit;
2 . Delete text and exit. NullString not show.

Why ?

Thans for your help.

Martin

Answers approved by DevExpress Support

created 11 years ago (modified 10 days ago)

Hello,
This behavior is by design. After you clear the editor's value, its EditValue is not Null and equals an empty string.
I recommend you use the Properties.ClearKey property to accomplish your task.
I hope that this information helps.
[Updated:]
If you wish to do this via code, I recommend you use the postponed procedure (PostMessage) in the OnValidate event handler and set the cxBarEditItem1's EditValue to Null:

Delphi
procedure <AForm>.<AcxBarEditItem>PropertiesValidate(Sender: TObject;   var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); begin   PostMessage(Handle, UM_MYMESSAGE, Integer(<AcxBarEditItem>), 0); end; procedure TForm1.umMyMessage(var Message: TMessage); begin   if TcxBarEditItem(Message.WParam).EditValue = '' then     TcxBarEditItem(Message.WParam).EditValue := Null; end;

I hope that this information helps.

    Show previous comments (5)

      Ok. The sample is here
      Martin

      DevExpress Support Team 11 years ago

        I was not able to reproduce this behavior. Attached is your example with an executable file (*.exe) that works as expected on my side with PostEditValue:

        Delphi
        procedure TForm1.cxBarEditItem1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); ... begin (Sender as TcxButtonEdit).PostEditValue; if AButtonIndex = 0 then begin ... end; end;

        Please take a look at the attachment and test it.

          You're right, in this project it works. Problem is somewhere in my main project. Perhaps I can find it. Thanks for your time.
          Martin

          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.