Ticket T552485
Visible to All Users

a GridControl cell isn't immediately updated when it's activated and its value is changed in code

created 8 years ago

[DevExpress Support Team: CLONED FROM T552184: Validate all grid rows]
Hi,

The cell validation works, however even though I have EnableImmediatePosting set to true, the cell still doesn't update until it loses focus, I guess this is because I am nulling the value in code, if you can suggest a better method for both of these that would be appreciated.

Thanks
Justin

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hello,
Am I right that you mean the "Clear" button located in your columns? If so, this behavior occurs because your cell is active when you change its value. When a certain cell is active, it doesn't immediately update its value when it's changed externally, for example, in code. To force the updating process, it's necessary to close and reopen this cell. To accomplish this task, you can use, for example, TableView's CloseEditor and ShowEditor methods. You need to call these methods at your ViewModel level after the Frequency property is reset. For this, you can create and use a custom service. We have an example demonstrating how to use custom services with our controls: How to display data which is being updated on another thread.

Thanks,
Kirill

    Comments (2)
    JE JE
    Justin Etherington 2 8 years ago

      Hi Kiril,

      Thanks for the prompt response, I've implemented both of these bits in the validate cell which seems to work perfectly.
      It would be good if there was a service out of the box for clearing the controls that allow buttons to be added, I would imagine this is a fairly common requirement.

      Thanks
      Justin

      Kirill (DevExpress Support) 8 years ago

        You are welcome!
        In general, our editors already have such a property: the NullValueButtonPlacement property. However, due to GridControl's specificsm this property will work in the same manner as your custom command. So, it will be necessary to catch the moment when your cell is cleared and reopen a corresponding editor.

        Thanks,
        Kirill

        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.