I have to display information in datagrid some information is about 1000 record from the database (sqlserver) but to display this information c# take unless 4 sec to do that ….
And how work with the application when he don’t see the result immediately he continue to press the button and the application repeat the same function many time due to that (sad) …
I make a break point the time is between the end of the function and the display of window or datagrid … are that normal !!!!
If yes there’s any solution to display a p开发者_运维技巧art and when he use the scroll the datagrid add another part (like facebook) ??
The best solution is to implement paging. There is an article at http://www.eggheadcafe.com/tutorials/aspnet/8a2ea78b-f1e3-45b4-93ef-32b2d802ae17/wpf-datagrid-custom-paging-and-sorting.aspx that covers it.
Regardless, make sure you disable the button until the grid has finished displaying, and show a wait cursor as well. A user should never have to wonder if the application is working or failing.
I've seen that happen too - when loading a large amount of data, the grid can take a few seconds to bind to the datasource, making the UI appear to freeze. You'll need to look up info on paging data in WPF, such as this link:
http://social.msdn.microsoft.com/Forums/en/wpf/thread/f72b38f1-38d6-4894-ab86-9a2e5ab5cdac
精彩评论