0

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

4

1 回答 1

1

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.

于 2010-01-05T11:50:52.387 回答