|
-
Jul 10th, 2007, 05:13 AM
#1
Thread Starter
Addicted Member
Delete Row in Listview Control
Hello,
I am in a problem. The problem is that I have got a listview control. The control is populated with some data and the listview's view property is set to report view. What I want is that when I select a row in the listview I want to delete that row. Is it possibl. If yes please give me any idea.
Thanx in advance.
Arghya
-
Jul 10th, 2007, 05:29 AM
#2
Re: Delete Row in Listview Control
And what initiates the deletion? Button click? Listview double click?
Code:
If Not (ListView1.SelectedItem Is Nothing) Then
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End If
-
Jul 10th, 2007, 08:40 AM
#3
Re: Delete Row in Listview Control
If your listview is being populated from a DB table, then you will need to delete the record from the table as well otherwise, the next time you load your listiview, that row will be back.
-
Jul 11th, 2007, 02:43 AM
#4
Thread Starter
Addicted Member
Re: Delete Row in Listview Control
Thanx to all for the reply and the trouble you have taken to reply to such a silly question. Now can anyone tell me how to change the forecolor and the font style of the last row of the listview control?
Thanx again
-
Jul 11th, 2007, 03:05 AM
#5
Addicted Member
Re: Delete Row in Listview Control
ListView1.ListItems(ListView1.ListItems.Count).Bold = True
ListView1.ListItems(ListView1.ListItems.Count).ForeColor = vbBlue
Some times when you make a step forward ...You can't get back. Be sure where you make your steps.
-
Jul 11th, 2007, 03:23 AM
#6
Re: Delete Row in Listview Control
vb Code:
Dim i As Long
i = ListView1.ListItems.Count
ListView1.ListItems(i).Bold = True
ListView1.ListItems(i).ForeColor = vbBlue
He only wants the last row to be changed
-
Jul 11th, 2007, 03:26 AM
#7
Addicted Member
Re: Delete Row in Listview Control
Short + Efficient = Hell-Lord
Some times when you make a step forward ...You can't get back. Be sure where you make your steps.
-
Jul 11th, 2007, 03:32 AM
#8
Re: Delete Row in Listview Control
 Originally Posted by ashraf fawzy
Short Code + Efficient = Hell-Lord
Thanks
-
Jul 11th, 2007, 07:35 AM
#9
Re: Delete Row in Listview Control
Just make sure there's actually a listitem in the lisitems collection, otherwise you'll get an error.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|