Ticket T1059659
Visible to All Users

Which devexpress editor/grid events are awaited?

created 3 years ago (modified 3 years ago)

[DevExpress Support Team: CLONED FROM T964838: DevExpress WinForms Troubleshooting - Asynchronous Programming]

Hi Stas,
When using the async/await pattern on an application it will soon grow to the whole code base. At the end you will have async methods that are getting data from the network and affect the UI. The only way to call these methods properly is from a UI async event. These events are usually button clicks but there is also need for : Editor.Validated or Editor.EditValueChanged and Grid.CellValueChanged.
So my questions are:

  1. Which devexpress editor/grid events are awaited?
  2. Are you planning to support awaited event handlers on these events?

Answers approved by DevExpress Support

created 3 years ago

Most of the control UI-related events aren't awaitable as the UI needs to be updated immediately in most cases.
Otherwise, it would cause not friendly end-user experience - for instance, you would click a button or edit a cell that instead of updating its state will immediately run an asynchronous operation and update its state later. This changes though might affect other UI parts and make your application impossible to use.
All places in our controls where asynchronous processing is possible offer the Task parameter to which you can assign a task performing asynchronous work.
Examples of such events can be AutoSuggest or MoreRows. But these events cannot be awaited either due to the reasons we described in DevExpress WinForms Troubleshooting - Asynchronous Programming.

So, the events of our controls or any control events in general cannot be "awaited".
We also don't plan to implement a mechanism allowing "awaiting" of events in our controls.
To support asynchronous operations in your application, you may want to use the solutions we suggested at DevExpress WinForms Troubleshooting - Asynchronous Programming.

    Comments (2)

      Stas,
      Thanks, it's understood.

      DevExpress Support Team 3 years ago

        You are always welcome. Should you have any questions regarding our products, do not hesitate to contact us.

        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.