woody2
1
I have a Master-Detail Hierarchy page in version 2.59.2
On RowExpand of the master, the generated code invokes a data source method.
I want to add a default sort order.
If I click on the "Create Query" icon I get:

When I run, I get this error:
And the code looks like this is VS:
var rsjdDataGetJobMetricsResult = await RsjdData.GetJobMetrics(new Query() { Filter = $@"i => i => i.JobID == {args.JobID}", FilterParameters = new object[] { }, OrderBy = $"OrderSeq asc" });
if (rsjdDataGetJobMetricsResult != null)
{
args.JobMetrics = rsjdDataGetJobMetricsResult.ToList();
}
enchev
2
Hey @woody2,
In OData filter expression equal is eq not ==. More info can be found here:
https://www.odata.org/documentation/odata-version-3-0/url-conventions/
woody2
3
This works:
It generates
var rsjdDataGetJobMetricsResult = await RsjdData.GetJobMetrics(new Query() { Filter = $@"i => i.JobID == {args.JobID}", OrderBy = $"OrderSeq asc" });
if (rsjdDataGetJobMetricsResult != null)
{
args.JobMetrics = rsjdDataGetJobMetricsResult.ToList();
}
As soon as I use the "Create Query" option

Without changing anything in Radzen (other than pressing the Create Query icon), the code changes to
var rsjdDataGetJobMetricsResult = await RsjdData.GetJobMetrics(new Query() { Filter = $@"i => i => i.JobID == {args.JobID}", FilterParameters = new object[] { }, OrderBy = $"OrderSeq asc" });
and I get the run-time error again.
I guess I don't understand the difference between adding $filter and $orderby filters "by hand" vs using the "Create Query" option.