nullschritt Posted July 17, 2013 Share Posted July 17, 2013 (edited) 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 July 17, 2013 by nullschritt Link to comment Share on other sites More sharing options...
nullschritt Posted July 17, 2013 Author Share Posted July 17, 2013 (edited) On further debugging the command _GUICtrlListView_DeleteAllItems($keyslist) returns false when I try to execute it. What could cause this? Edited July 17, 2013 by nullschritt Link to comment Share on other sites More sharing options...
AZJIO Posted July 17, 2013 Share Posted July 17, 2013 nullschritt The example in the help file works? My other projects or all Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted July 17, 2013 Moderators Solution Share Posted July 17, 2013 nullschritt, I see you use the UDF functions to add the items - are you creating the ListView with teh native GUICtrlCreateListView function? 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nullschritt Posted July 17, 2013 Author Share Posted July 17, 2013 (edited) nullschritt, I see you use the UDF functions to add the items - are you creating the ListView with teh native GUICtrlCreateListView function? 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 July 17, 2013 by nullschritt Link to comment Share on other sites More sharing options...
kylomas Posted July 17, 2013 Share Posted July 17, 2013 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 More sharing options...
Moderators Melba23 Posted July 17, 2013 Moderators Share Posted July 17, 2013 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kylomas Posted July 17, 2013 Share Posted July 17, 2013 M23, Thanks...I read the ticket and recalled having the same problem some time ago. @nullschritt - ALWAYS follow the advice of the "God of Gui's" (M23)... 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 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