Nithyanandam Posted June 23, 2009 Posted June 23, 2009 HI plp, I want to delete the list view items using the function _GUICtrlListView_DeleteAllItems But i cant since I loaded the array values in the ListView. Code: _GUICtrlListView_DeleteAllItems($hListView) _GUICtrlListView_AddArray($hListView, $aRow2) When i put this code in a loop, instead of updating the Listview, the rows in the listview gets added up.... How to delete the ListView items completly without destroying the Listview.... Please see the attachment for a visual, which gives more understandings.....
Nithyanandam Posted June 24, 2009 Author Posted June 24, 2009 I have checked it once again, and I think I the error is _GUICtrlListView_DeleteAllItems($hListView) _GUICtrlListView_AddArray($hListView, $aRow2) For $index = _GUICtrlListView_GetItemCount($hListView) - 1 To 0 Step -1 _GUICtrlListView_DeleteItem($hListView, $index) $ctrlID = _GUICtrlListView_GetItemParam($hListView, $index) If $ctrlID Then GUICtrlDelete($ctrlID) msgbox (0,"$ctrlID","$ctrlID = "&$ctrlID&" $index = "&$index &" Item Count = "&_GUICtrlListView_GetItemCount($hListView)) Next
Nithyanandam Posted June 24, 2009 Author Posted June 24, 2009 I have checked it once again, this approach also doesnt work.... Code :- _GUICtrlListView_DeleteAllItems($hListView) _GUICtrlListView_AddArray($hListView, $aRow2) For $index = _GUICtrlListView_GetItemCount($hListView) - 1 To 0 Step -1 _GUICtrlListView_DeleteItem($hListView, $index) $ctrlID = _GUICtrlListView_GetItemParam($hListView, $index) If $ctrlID Then GUICtrlDelete($ctrlID) msgbox (0,"$ctrlID","$ctrlID = "&$ctrlID&" $index = "&$index &" Item Count = "&_GUICtrlListView_GetItemCount($hListView))Next
ReFran Posted June 24, 2009 Posted June 24, 2009 Fom helpfile: _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView)) HTH, Reinhard
everseeker Posted June 26, 2009 Posted June 26, 2009 I have checked it once again, this approach also doesnt work.... Code :- If you enclose your AutoIt code with [ autoit ] code [ /autoit ] you will get the following (a bit easier to look at ) _GUICtrlListView_DeleteAllItems($hListView) _GUICtrlListView_AddArray($hListView, $aRow2) For $index = _GUICtrlListView_GetItemCount($hListView) - 1 To 0 Step -1 _GUICtrlListView_DeleteItem($hListView, $index) $ctrlID = _GUICtrlListView_GetItemParam($hListView, $index) If $ctrlID Then GUICtrlDelete($ctrlID) msgbox (0,"$ctrlID","$ctrlID = "&$ctrlID&" $index = "&$index &" Item Count = "&_GUICtrlListView_GetItemCount($hListView)) Next Everseeker
everseeker Posted June 26, 2009 Posted June 26, 2009 Member number 50,561?Good lord, I feel old! Everseeker
Nithyanandam Posted June 26, 2009 Author Posted June 26, 2009 Fom helpfile:_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView))HTH, ReinhardThanks, it works perfect now.... Sasikumar
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