|
-
Feb 2nd, 2006, 05:02 AM
#1
[RESOLVED] ListView Control - Allow User Editing !??
Hi i have a Listview in one of my projects (in Report view) that i need the user to be able to click on any cell and modify the value.
My Listview has 4 columns which i populate in the following manner !!
VB Code:
Public Sub ListSetup(lst As ListView,n As Integer)
'Litems Array is Created and populated elsewhere !
Dim lvi As Object
Set lvi = lst.ListItems.Add(, "A" & CStr(n), Litems(0))
lvi.SubItems(1) = Litems(1)
lvi.SubItems(2) = Litems(2)
lvi.SubItems(3) = Litems(3)
lvi.SubItems(4) = Litems(4)
End Sub
My problem is that no matter what option i try i can't seem to make all the Cell's editable when you click into them. Only the rows in the first column are editable !!!!
Also only the rows in the FIRST column will highlight when you click on them.
So, does anyone know of a way to change this behaviour so that the user can edit any cell in the Listview by double clicking on it, as changing the LabelEdit property only seems to work for first Column !
Thanks
Rich
-
Feb 2nd, 2006, 05:08 AM
#2
Re: ListView Control - Allow User Editing !??
I don't see any editing code, but let me suggest a flxgrid. It is very versatile, and allow you to format and edit any cell.
Search the forum for MS FLEXGRID
-
Feb 2nd, 2006, 06:36 AM
#3
Re: ListView Control - Allow User Editing !??
Yes i thought that might be the route i would have to go down !!,
can you populate a FlexGrid from an Array ??, they are not bound to a DB or anything ??
-
Feb 2nd, 2006, 06:56 AM
#4
Re: ListView Control - Allow User Editing !??
I prefer ListViews and use textboxes for editing.
When a listview item is selected, I dump the whole row to individual textboxes any of which can be modified. Saving writes the modified data back to the database, updates the listview and clears our the textboxes. My customers like it as they can easily modifiy any column within any row of the ListView.
-
Feb 2nd, 2006, 08:06 AM
#5
Fanatic Member
Re: ListView Control - Allow User Editing !??
You can try using my LabelEdit SubItems code; it uses a textbox to let users edit individual cells.
Author for Visual Basic Web Magazine
-
Feb 3rd, 2006, 05:44 AM
#6
Re: ListView Control - Allow User Editing !??
Thanks TheVader !!!
I Like your Subclassing solution alot works great !
Unfortunatly i can't use it in some of my VBA application as you can't get a proper handle on the Userform object in VBA and the code error's, but have already put this into use in one of my VB projects to great effect !!!
Thanks you !!
-
Jan 23rd, 2008, 02:46 PM
#7
Addicted Member
Re: ListView Control - Allow User Editing !??
 Originally Posted by Hack
I prefer ListViews and use textboxes for editing.
When a listview item is selected, I dump the whole row to individual textboxes any of which can be modified. Saving writes the modified data back to the database, updates the listview and clears our the textboxes. My customers like it as they can easily modifiy any column within any row of the ListView.
Old thread, I know, but that's what the search is for, right? Anyway, Hack. Can you explain/show how you get the row that the user has selected? I'm trying to do basically the same thing but with a collection.
Thanks!
-
Feb 13th, 2008, 03:34 AM
#8
Addicted Member
Re: [RESOLVED] ListView Control - Allow User Editing !??
i'm just curious .. does this confirm that the ListView control do not allow user edit? Meaning we need to use the workaround such as having a hidden textbox and etc right?
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
|