Sign in to follow this  
Followers 0
jonny1234

Two ListView Questions

8 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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,

Jonny

Look for GUICtrlRegisterListViewSort in the help

GUICtrlSetBkColor

GUICtrlSetColor

Edited 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.

 

Share this post


Link to post
Share on other sites

Look for GUICtrlRegisterListViewSort in the help

Tried 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.

GUICtrlSetBkColor

GUICtrlSetColor

It 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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by randallc

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by randallc

Share this post


Link to post
Share on other sites

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.au3

ExampleSortIcons.au3

lastfile_tabs.au3

lastfiles_tabs_v3.au3

SearchFast.au3

searchMine.au3

I think I will just display part of the list at a time as you previously suggested.

Regards,

Jonny

Share this post


Link to post
Share on other sites

#8 ·  Posted (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.au3

ExampleSortIcons.au3

lastfile_tabs.au3

lastfiles_tabs_v3.au3

SearchFast.au3

searchMine.au3

I think I will just display part of the list at a time as you previously suggested.

Regards,

Jonny

Yes, 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 by randallc

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0