Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Lazy Load Child Rows
posted

Hi,

I have a XamDataGrid showing Orders. Orders have associated Tasks. I have these displayed hierarchically in a grid but due to the fact the data is being sent over a WCF service I want to Lazy Load the Tasks (child rows) to speed up the initial loading of the grid. I tried to do this by binding the Tasks via a property like so:

private List<TaskDTO> _tasks = null;
public List<TaskDTO> Tasks
{
get
{
if (_tasks == null)
_tasks = GetTasks(OrderId);

return _tasks;
}
}

However when I hit the plus sign to expand the Child Rows it looks like it is going to expand and then doesn't. The plus sign turns to a minus sign but with no data in there. 

I have checked data is actually returned from the service and is placed into the _tasks variable. 

The above property also only seems to be evaluated the first time I hit the plus (I guess this is some kind of caching in the xamDataGrid).

Is there a better way of trying to lazy load the child rows or am I missing something with how I am trying to implement it?

Cheers,
Dave