PageRenderTime 5962ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSWinFormDataGridView/JustInTimeDataLoading/ReadMe.txt

#
Plain Text | 55 lines | 35 code | 20 blank | 0 comment | 0 complexity | 3072f3f59843d4ba3b651c0b8cb8dec5 MD5 | raw file
  1. ================================================================================
  2. WINDOWS FORMS APPLICATION : CSWinFormDataGridView Project Overview
  3. JustInTimeDataLoading Sample
  4. ===============================================================================
  5. /////////////////////////////////////////////////////////////////////////////
  6. Use:
  7. This sample demonstrates how to use virtual mode in the DataGridView control
  8. with a data cache that loads data from a server only when it is needed.
  9. This kind of data loading is called "Just-in-time data loading".
  10. /////////////////////////////////////////////////////////////////////////////
  11. Remark:
  12. If you are working with a very large table in a remote database, for example,
  13. you might want to avoid startup delays by retrieving only the data that is
  14. necessary for display and retrieving additional data only when the user scrolls
  15. new rows into view. If the client computers running your application have a
  16. limited amount of memory available for storing data, you might also want to
  17. discard unused data when retrieving new values from the database.
  18. /////////////////////////////////////////////////////////////////////////////
  19. Code Logic:
  20. 1. Enable VirtualMode on the DataGridView control by setting the VirtualMode
  21. property to true:
  22. this.dataGridView1.VirtualMode = true;
  23. 2. Add columns to the DataGridView according to the data in the database;
  24. 3. Retrieve the row count of the data in the database and set the RowCount
  25. property for the DataGridView;
  26. 4. Handle the CellValueNeeded event to retrieve the requested cell value
  27. from the data store or the Customer object currently in edit.
  28. /////////////////////////////////////////////////////////////////////////////
  29. References:
  30. 1. Implementing Virtual Mode with Just-In-Time Data Loading in the Windows
  31. Forms DataGridView Control
  32. http://msdn.microsoft.com/en-us/library/ms171624.aspx
  33. 2. Windows Forms FAQs
  34. http://windowsclient.net/blogs/faqs/archive/tags/Custom+Designers/default.aspx
  35. /////////////////////////////////////////////////////////////////////////////