Jump to content

Clearing all items from a list view


Go to solution Solved by Melba23,

Recommended Posts

Hello, I have been working with listviews recently, and have run into a problem I cannot seem to solve, everything in my code looks right.

Basically it pulls the data from a sqlite database and then adds it to a list view, however, the list view isn't clearing each time I update it, causing duplicate entries.

(_GUICtrlListView_DeleteAllItems does not seem to be working)

*SOLVED, NEEDED TO UPDATE TO BETA, BUG IN RELEASE VERSION*
Edited by nullschritt
Link to comment
Share on other sites

  • Moderators
  • Solution

nullschritt,

I see you use the UDF functions to add the items - are you creating the ListView with teh native GUICtrlCreateListView function? :huh:

If so, then you are the victim of a bug in the last release version of _GUICtrlListView_DeleteAllItems which was reported and is fixed #2252 in the Beta. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

nullschritt,

I see you use the UDF functions to add the items - are you creating the ListView with teh native GUICtrlCreateListView function? :huh:

If so, then you are the victim of a bug in the last release version of _GUICtrlListView_DeleteAllItems which was reported and is fixed #2252 in the Beta. ;)

M23

This must be the problem, I am doing it this way to keep it inside a tab control.

Where can I download the latest beta, all I could find was this link http://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/ and none of the files there seem to be relevant to compile or executing scripts?

Nevermind, was in the wrong area.

This fixed the problem, thanks!

Edited by nullschritt
Link to comment
Share on other sites

nullschritt, M23,

Does it help if you delete the items like this?

$ret = _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lst010))

I ran into something similar to this using various comibation of native and UDF LV functions.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

  • Moderators

kylomas,

It might - as I explained in the Trac ticket:

 

"The current implementation of _GUICtrlListView_DeleteAllItems assumes that if the ListView is created with the native function GUICtrlCreateListView then the items are created with the native GUICtrlCreateListViewItem function - and that a UDF created ListView (GUICtrlListView_Create) has UDF created items"

So passing the handle rather than the ControlID might fool the old function. But better to use the new one - then all avenues are covered (I hope!). ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...