How to get the Return of a dxDataGrid Method when it is a Promise?

Answered
0
0

Hi.

I have a feeling this has nothing to do with Wisej, but I need to get a DevExtreme dxDataGrid Selected Rows to deal with them. So, the docs give us the getSelectedRowKeys(), which returns an Array.
https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#getSelectedRowKeys
But it looks like we will get a Promise from the method. If I just call it from C#, I get null returning. If I add an “await” in the call, I get an error.


var keys = this.dxDataGrid1.Instance.getSelectedRowKeys();

Would you guys give me some directions on how to use this method and get the array of the Selected Row Keys?

Thanks in advance.

Ivan
(Wisej 2.2.55.0 – VS 2019 – C#)

  • You must to post comments
Best Answer
0
0

Hi Ivan,

You can try this:

var keys = await this.dxDataGrid1.Instance.getSelectedRowKeysAsync();

When using the Instance singleton, you can add Async to the end of any asynchronous method and Wisej will automatically await and return the result of the call.

 

Let me know if this works for you!

 

Regards,

Levie

  • You must to post comments
0
0

Hi Levie.

Amazing! That worked perfectly.
Thank you.

Ivan

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.