Method is called twice on load

I am trying to populate a grid, based on sproc results, with parameters passed, on load. When I use the results of the sproc as the binding property, I end up with the api being called twice. Once with the parameters, and once with null parameters, and I end up with all data, not just the data I want:


Note that the first call is correct.

Binding to the grid looks like this (second one is the count):
image

Page load event looks like this:
image

And like I said above, the displayed grid results are the unfiltered results of the second call, not the filtered results that I want from the first call. Paging in this case, works fine, as one would expect.

I tried binding to the claims property, which is set in the load event (above), like this:
image
The result is that I can see the first 10 records, but there is no paging. I have tried binding the count to ${claims.count} and ${claims}.Count(); but these don't work.

For some reason the count property is returned by the API when no parameters are passed:

But no count property is returned when the parameters are passed:


Why would that be the case?

Binding the second way, I still get two API calls, the first with parameters and the second without, but at least doing it that way, I do get the correct results in the grid, less the needed paging.

How can I get paging to work, and why is the API being called twice?

The other problem I have is that I am trying to bind the pageTitle to the ${header} page property, which is set on page load (above) to null, and then is updated after the API call.
image
When I do this, no data displays, because the page throws an exception:

If I move the statement that assigns the ${header} property to here, I get a different error:
image

Why?

Not sure how this code is created however if you use the Radzen wizard from Data property of the DataGrid binding to stored procedures will work properly:

The stored procedures invoke is executed in LoadData event of the DataGrid:


*you need to add non query parameters by yourself, the wizard will add just parameters related to the query like $top, $skip, $filter, $count, etc.

and in Page Load event there is only execute load() of the grid:

Here is how it works runtime:

The error says that this.claims[0] is null and you cannot read the property FNAME.

Thank you. I'm working on an application created by someone who is no longer with the company, and I'm now seeing that he didn't necessarily do things the "right" way according to how Radzen works. I did get the grid working correctly.

I still have the issue with the error on trying to set the heading. Here is my LoadData event on the grid:
image
How do I get the 1.1.5 event to not happen until the async call is completed. Logic would tell me that that is what the "Then" is for at 1.1, but it doesn't work. It is obviously trying to assign the value to ${header} before the async call is complete. I tried to set the header to "Loading..." and then set it after the call, as you can see in the LoadData event, but that didn't work. How do I make it wait until it has the value?

I figured out a way to get it to work. I ended up moving the database call to the page load function, and did the assignment there after the call.