|
-
Feb 27th, 2003, 07:26 PM
#1
Thread Starter
Addicted Member
Edit content in listview
Hi!
I need to be able to edit every row under a column in a listview control. VB does this almost automatic with the labeledit property, but only with the listitem (the first column), not the listsubitems..
I could of course swap the order of my columns, but that would look very weird
Any suggestions?
-
Feb 27th, 2003, 08:50 PM
#2
Frenzied Member
Something that isn't easy and at the same time isn't difficult to implement: you'll need to create a floating Textbox that perfectly fit inside each cell (especially when gridlines are visible). So, good luck.
-
Jun 24th, 2003, 02:28 AM
#3
Lively Member
Surely there is an easier way than that... thats crazy talk LOL
-
Jun 24th, 2003, 03:29 AM
#4
there is no edit property for subitem labels but you could edit them like this :
VB Code:
Private listMainItem As String
Private Sub Form_Load()
With ListView1
.ListItems.Add 1, , "item 1"
.ListItems.Add 2, , "item 2"
.ListItems(1).ListSubItems.Add , , "subitem 1"
.ListItems(2).ListSubItems.Add , , "subitem 2"
End With
End Sub
Private Sub ListView1_AfterLabelEdit(Cancel As Integer, NewString As String)
ListView1.SelectedItem.ListSubItems(1).Text = NewString '///make the subitem become the edited item.
NewString = listMainItem '/// make the main item back to it's original text.
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
listMainItem = ListView1.SelectedItem.Text '///asign exsisting main item to a string.
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
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
|