jonny1234 Posted November 25, 2006 Share Posted November 25, 2006 Hi, Please could you tell me the fastest way to sort a ListView with 10000 rows when the user clicks on a column header. Also, I would like to know if it is possible to set the background colour or text colour of a single ListView cell. Thanks for your help. Regards, Jonny Link to comment Share on other sites More sharing options...
GaryFrost Posted November 25, 2006 Share Posted November 25, 2006 (edited) Hi,Please could you tell me the fastest way to sort a ListView with 10000 rows when the user clicks on a column header.Also, I would like to know if it is possible to set the background colour or text colour of a single ListView cell.Thanks for your help.Regards,JonnyLook for GUICtrlRegisterListViewSort in the helpGUICtrlSetBkColorGUICtrlSetColor Edited November 25, 2006 by Lobishomen SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jonny1234 Posted November 26, 2006 Author Share Posted November 26, 2006 Look for GUICtrlRegisterListViewSort in the helpTried the examples. Took about 8 seconds for 1000 rows, so I didn't even try 10000. And looking at the code, I'm not sure that the sorting would continue to work if list items were to be deleted and inserted, since it would result in duplicate saved index values. So I think I'll have to leave it. But thanks for the pointer anyway.GUICtrlSetBkColorGUICtrlSetColorIt seems that it's only possible to change the colour of an entire ListView row and not just a single cell, but this will probably be OK.Regards,Jonny Link to comment Share on other sites More sharing options...
randallc Posted November 26, 2006 Share Posted November 26, 2006 (edited) H, Fastest I have seen is by using my UDF functions; I agree (and keep complaing) that the Register Sort method is slow; mine uses vbscript to speed it up (get it from the zip linked in signature; examples there; ) Let me know how you go! Best, Randall EDIT; anything over 4000 in a ListView takes forever to Display, anyway, so can't go much over that number; If you want 10000, you will need to consider options of displaying only part of the list at a time; see my DirSQL for example; or @ptrex ado sort/ display solution; either gives rapid sorting and display for a million if need be... Edited November 26, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
jonny1234 Posted November 26, 2006 Author Share Posted November 26, 2006 Thanks for your reply, Randall. Couldn't get your sorting to work. I got an error: Line 624 of _GUICtrlListView.au3: $ar_Array = $vbs.run ("Quick_SortColumn1", $ar_Array, $First, $Last, $i_ViewColNum - 1) Error: The requested action with this object failed. Regards, Jonny Link to comment Share on other sites More sharing options...
randallc Posted November 26, 2006 Share Posted November 26, 2006 (edited) Hi,$ar_Array = $vbs.run ("Quick_SortColumn1", $ar_Array, $First, $Last, $i_ViewColNum - 1)Maybe you are on Win98? - I have a version for that too...If not, can you post or PM me your script? (or was this using the eaxmple in the zip - if so, which one?)Randall Edited November 26, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
jonny1234 Posted November 26, 2006 Author Share Posted November 26, 2006 Maybe you are on Win98? - I have a version for that too...I'm using Windows 2000. I wrote a short script to test the sorting, but I've deleted it. But I also get a "requested action with this object has failed" error when running some of the examples:2GUIsArIcons.au3ExampleSortIcons.au3lastfile_tabs.au3lastfiles_tabs_v3.au3SearchFast.au3searchMine.au3I think I will just display part of the list at a time as you previously suggested.Regards,Jonny Link to comment Share on other sites More sharing options...
randallc Posted November 26, 2006 Share Posted November 26, 2006 (edited) I'm using Windows 2000. I wrote a short script to test the sorting, but I've deleted it. But I also get a "requested action with this object has failed" error when running some of the examples:2GUIsArIcons.au3ExampleSortIcons.au3lastfile_tabs.au3lastfiles_tabs_v3.au3SearchFast.au3searchMine.au3I think I will just display part of the list at a time as you previously suggested.Regards,JonnyYes, On Win2K, any of the examples which use file lists made by DOS are incorrect and do not work;but you should not have an error with the simplest Example file; "_GUICtrlListViewSorter.au3"?Best, Randall Edited November 26, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now