Hi,
I get a NullReferenceError when the results are empty from a GetChildren data operation.
For example, after creating a page using the Mater/Detail Hierarchy wizard, the code to load the children on RowExpand is this:
${result}.ToList().ForEach(event.ShipmentItems.Add);
suggest changing to this:
if(${result} != null && ${result}.Any()) {${result}.ToList().ForEach(event.ShipmentItems.Add);};
*EDIT: Turns out Any() and Count() methods excute an extra db query so this is preferred:
var res = ${result}.ToList(); if(res.Count != 0){res.ForEach(args.ShipmentItems.Add);}
or better yet, avoid .ForEach():
foreach(var r in ${result}.ToList()){event.ShipmentItems.Add(r);}
Thanks,
Josh