Click to See Complete Forum and Search --> : Listview limitatations: # records and rt-clicking?
jkkast
Jun 12th, 2002, 07:51 AM
Can I use a listview if I have more than 33,000 records? If not, what could be an alternative? I require the capability to select multiple records from the listview, and to rt-click on a selection of records for a pop-up menu to sort, delete, search. Please help!!
Cander
Jun 12th, 2002, 08:48 AM
i would think that it could..BUT..you should consider some kind of paging..perhaps only show a couple thousand at a time and when you click a button, show the next couple thousand and so on.
Right click menu:
declare this public
Public mnuContext As ContextMenu
now create the menu in your forms loading code/constructor
mnuContext = New ContextMenu()
mnuContext.MenuItems.Add(new MenuItem("Unzip", New EventHandler(mnuUnzip_Clicked)))
Listview1.ContextMenu = mnuContext
Then just create a sub called mnuUnzip_Clicked like this
Sub btnUnzip_Click(ByVal sender As Object , ByVal e As System.EventArgs)
Repeat this line
mnuContext.MenuItems.Add(new MenuItem("Unzip", New EventHandler(mnuUnzip_Clicked)))
for each menuitem where Unzip is the wording in the menu and mnuUnzip_Clicked is the sub to run whe that item is clicked
jkkast
Jun 12th, 2002, 09:17 AM
Thank you for your response.
Two questions:
1. I thought I could get the menu to appear on the right click event, but there is no such event in the listview control.
2. For the paging suggestion, is there some standard code that exists to page through table every 5000 records or so?
Thanks
Cander
Jun 12th, 2002, 09:20 AM
1) The magic of right click is handled by Inheritance. There is nothing you have to do extra. The code I gave creates a ContextMenu object. That object automatically listens for the right click
2) No listview doesnt, but I believe the Datagrid does as you were asking about in your other post. I havent used Datagrid that much yet, but I have heared that paging is built in.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.