views:

38

answers:

1

I have a master-detail display in a single Silverlight view. The master is a DataGrid of partially populated items. When I select an item in the DataGrid, my service returns a fully populated data object, which is rendered in the Detail view.

This causes a problem when the user scrolls the data grid with the keyboard cursor keys because the "loadDetails()" service method is getting called for every item that the user scrolls past.

How can I delay the LoadDetails() call for a few milliseconds to ensure the user has 'settled' on an item for which they want to get details?

Thanks,
Mark

+1  A: 

You should implement a delay timer on the OnItemSelected event of your datagrid, when the timer expires, you can execute your LoadDetails() function.

Or place load details in another thread, put the thread to sleep for x milliseconds and then start the thread. This is a bit more complicated when you then want to write back to your GUI from that thread.

Tony
Thanks for the prompt response, I'll give this a go.
Mark Cooper