Virtual listView in .net2.0

 

 1     VirtualMode  =   true ;
 2     VirtualListSize  =  value;
 3     
 4      private   void  lvwEvents_RetrieveVirtualItem( object  sender, RetrieveVirtualItemEventArgs e)
 5          {
 6           int index = e.ItemIndex % pageSize;
 7           if ((e.ItemIndex > currentPage * pageSize) || (e.ItemIndex < (currentPage - 1* pageSize))
 8           {
 9               currentPage = (e.ItemIndex / pageSize == 0? 1 : ((e.ItemIndex / pageSize) + 1);
10               DataBind();
11           }

12           EventLog log = logList[index];
13           ListViewItem item = new ListViewItem(new string[] {
14                                                    log.Time.ToString(),
15                                                    log.Content,
16                                                    log.UserName,
17                                                    log.Source}
-1);
18           item.Tag = log;
19           e.Item = item;
20
21        }

22

你可能感兴趣的:(ListView)