PageRenderTime 17ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/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       
 4                   JustInTimeDataLoading Sample
 5                        
 6===============================================================================
 7
 8/////////////////////////////////////////////////////////////////////////////
 9Use:
10
11 This sample demonstrates how to use virtual mode in the DataGridView control 
12 with a data cache that loads data from a server only when it is needed. 
13 This kind of data loading is called "Just-in-time data loading". 
14
15
16/////////////////////////////////////////////////////////////////////////////
17Remark:
18
19 If you are working with a very large table in a remote database, for example, 
20 you might want to avoid startup delays by retrieving only the data that is 
21 necessary for display and retrieving additional data only when the user scrolls 
22 new rows into view. If the client computers running your application have a 
23 limited amount of memory available for storing data, you might also want to 
24 discard unused data when retrieving new values from the database.
25
26
27/////////////////////////////////////////////////////////////////////////////
28Code Logic:
29
301.  Enable VirtualMode on the DataGridView control by setting the VirtualMode
31    property to true:
32    
33    this.dataGridView1.VirtualMode = true;
34                        
352.  Add columns to the DataGridView according to the data in the database;
36
373.  Retrieve the row count of the data in the database and set the RowCount 
38    property for the DataGridView;
39    
404.  Handle the CellValueNeeded event to retrieve the requested cell value 
41    from the data store or the Customer object currently in edit. 
42
43
44/////////////////////////////////////////////////////////////////////////////
45References:
46
471. Implementing Virtual Mode with Just-In-Time Data Loading in the Windows 
48   Forms DataGridView Control
49   http://msdn.microsoft.com/en-us/library/ms171624.aspx
50   
512. Windows Forms FAQs
52   http://windowsclient.net/blogs/faqs/archive/tags/Custom+Designers/default.aspx
53
54
55/////////////////////////////////////////////////////////////////////////////