listctrl with large number of items
-
hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan
-
hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan
One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
-
hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan
use the owner-data option to make freeing memory faster Don't try it, just do it! ;-)
-
One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
Maximilien wrote: Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ? Actually, a virtual list control is one that keeps only a small subset of the data items in memory at any one time. The rest of the data, while not being displayed, is kept in a data structure of some sort. The control uses the
LVS_OWNERDATA
style. -
One option would be to review your UI, having a list with 15000 items is useless and not really user friendly. Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ?
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
hi, thanks for ur reply. But i forgot to mention , the listctrl lists files searched from the disk, and i was only making sure it displays a very large number of entries. As you can see, i can't review the interface, as i should expect any large number. BTW, after posting here, i tried the ownerdraw style, but the check boxes are not shown. The check box space is empty. Hari Krishnan
-
Maximilien wrote: Have you tried using a owner draw list and keeping the data external to the list itself (not really a virtual list) ? Actually, a virtual list control is one that keeps only a small subset of the data items in memory at any one time. The rest of the data, while not being displayed, is kept in a data structure of some sort. The control uses the
LVS_OWNERDATA
style.hi, i tried this owner data option, but the check boxes are not shown. The space is empty. Hari Krishnan
-
hi, please help me get over this problem. I have a listctrl and it needs to display about 15000 items. But after displaying it, when i close the dialog, it takes a while to close the dialog. Can see the app running when i hit ctrl+alt+del. When i decrease the count , the dialog closes instantly. How can i close the dialog instantly ? The problem is more evident if i launch this dialog from another dialog, in that case the parent dialog is not redrawn until the child dialog closes completely. BTW, I dont want to use the virtual list. Hari Krishnan
Then try this: Override whichever function in your application which will be called before your main window(or frame) closes, for example, "OnCancel()" or "OnOK()" for a dialog based app, etc, then add just one single line of code into the very beginning of tha function body:
void CMyDlg::OnCancel() // or whatever in your project { m_wndList.LockWindowUpdate(); // m_list is the CListCtrl contains 15000 items // the rest of original code... }
This should shorten your waiting time by at least 1/2. -
hi, i tried this owner data option, but the check boxes are not shown. The space is empty. Hari Krishnan
In the context for which I mentioned the
LVS_OWNERDATA
style, it had nothing to do with checkboxes. Have you looked at the CCheckListBox class, or a list control with checkbox capability?