Windows Develop Bookmark and Share   
 index > Windows Forms General > Only call setter on visible items in lisbox control
 

Only call setter on visible items in lisbox control

Hello all,

I have a customl listbox control that inherits from listbox and implements the INotifyPropertyChanged interface. I would like to modify the default behavior of listbox so that it only calls the getter on visible items. I am planning on replacing my current custom DAL with an ORM and this behavior would be desirable because it would allow me to utilize lazy loading to only load what is currently needed.

Thanks in advance,

Dustin
Dustin Bryant  Tuesday, September 29, 2009 4:48 PM
I could be misunderstanding you but it sounds like you want a virtual ListBox. I don't think the Windows Forms ListBox provides any support for this. The Windows Forms ListView does support virtualization however. Is there any chance you could usea ListViewinstead of a ListBox? With the ListView's VirtualMode property set to true you no longer populate its Items collection but instead you handle the RetrieveVirtualItem event to tell the ListView what to display. The ListView will only request information about visible (or partially visible) items.
dekurver  Tuesday, September 29, 2009 7:24 PM

You can use google to search for other answers

Custom Search

More Threads

• Can I query an embedded (csv file) resource with LINQ?
• How to implement two form control Interaction hosting in IE?
• keypreview on combo boxes appear not to work
• Cross-thread operation not valid...
• Remote printers management via WMI.
• BorderColor for a Standard Button
• Windows Form application as logoff script.
• Datagrid Filter crashes applicaton
• Can't choose label size
• custom controls in C#