i am using a listview i want to be able to change the values inside the list i mean i want to write in the column i want and the row i want ( can i ? )
i m thinking to use it as areplace to datagrid control.
is there a good sample on using the datagrid or MSflixgrid as adetail in a form with powerfully dealing with rows and columns , can i set the focus on acetain row,column ?
Who is Participating?
If what you want to do is to allow the user to type directly in the Listview and edit the various columns, then no, you cannot do that (with the exception of the first column, if the LabelEdit property is set to automatic as above.)

For that purpose, I have had good luck with True DB Grid, but it costs money.

Of course, you can set the values of the various columns in the listview in your VB code.  You do this by using the listview style of lvwReport.  Then each ListItem object will have a property called SubItems.  The SubItems property is a collection of strings, that you can set each one by using an index into the collection.

Ryan ChongCommented:
Hi, Listview control is only allow one column (head - usually first column of listview) , when its LabelEdit property set to 0 - lvwAutomatic.

If you want to set focus on certain column and row, and due with database , then Datagrid control can be used.
Ryan ChongCommented:
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

in MSDN, you can find an topic "msflexgrid tips and trics" explaining how to implement an editable/sortable grid (a combination of msflexgrid and an textbox)

the code in the topic is very to the point.

the briefly discuss the differnce between the dbgrid and the msflexgrid (which probably is a better choice than the listview)

try this matey

'NOTE: You must include this procedure within a form
'      And the listview control is named ListView1
'      by Default.  It's easy enough to adjust the code
'      for your own needs (e.g., change ListView1 to the
'      the name of your List View, or rewrite the function
'      to accept the ListView control as a parameter

'Each PercentWidth value, (an integer), is the percent of the
'ListView box's width that is to be assigned to the column.

'If the total of the PercentWidth values exceed 100, the box will
'have a horizontal scrollbar.

'If the total is less than 100, an unusable section of the
'title area will be present in the ListView box.  If your
'data includes the need to scroll vertically, you might size
'your columns in such a way as to leave room for the vertical
'scrollbar.  Leaving room'for a scrollbar isn't mandatory.

'Author's Notes:
'This code assumes zero-based array-indexing.  If you're
'using 1-based indexing, make the necessary adjustments
'to and within the For-loop and to the parameter-check code.
'While the code works as-is, including its error-handling,
'you should adapt its error
'handling to your own requirements.
'After debugging, if all of your calls to this procedure are
'hard-coded and aren't under software-control, the
'parameter-check may be removed.  However, if your code
'constructs an indeterminate number of titles for the box,
'you may wish to incorporate the parameter-check into your
'error-handling scheme.
'The "80" is an "adjustment" factor.  When using the VB5 ListBox,
'change the value from "80" to 850.  Without it, specifying 100
'as the total for the various widths always includes a scrollbar
'in the ListView box.  That's not nice.

'Troubleshooting Problems With Input-Parameters
'Input Parameters               Result
' "First", 30                   "First" occupies 30% of the
'                                box's width. The remainder is
'                               an inactive (blank) title bar.
' "First", 30, "Second"         After display of the parameter-
'                               check error message,the
'                               display is the same as the
'                               previous sample.
' "First", "Second"             "Type Mismatch" error.  "Second"
'                               is a string and it should
'                               have been an integer.
' 40, "First"                   "Type Mismatch" error.  The
'                                parameters are reversed.  An
'                               integer should be first,
'                                followed by a string.
' "First", 40, 40               See second example.

'When presented with an odd-number of titles and widths, the
'procedure displays each pair and entirely omits the last

Public Sub AddColumnsToViewBox(ParamArray TitlesAndWidths())
    Dim i, Width, ParameterCount, Msg

    On Error GoTo ErrorHandler
    ListView1.View = lvwReport
    'Input-parameter check. (See Author's Note)
    ParameterCount = UBound(TitlesAndWidths) + 1
    If ParameterCount / 2 <> CInt(ParameterCount / 2) Then
       Msg = "Input-parameter count is incorrect.  You must " & _
              "specify an equal number of titles and widths."
        MsgBox Msg, , "Prameter-Count Error"
    End If
    Width = ListView1.Width - 80
    With ListView1.ColumnHeaders
        For i = 0 To UBound(TitlesAndWidths) - 1 Step 2
        .Add , , TitlesAndWidths(i), (TitlesAndWidths(i + 1) _
             * Width) / 100
        Next i
    End With
    Exit Sub
    MsgBox Err.Description & "."
End Sub


cheers A


raedAuthor Commented:
agriggs :

where from can i buy a good one ?
yes you can set the focus on a particular column and row in a grid.

just say

msfgrid.row = (what ever you want)
msfgrid.col = (what ever you want)

Sorry, raed, I missed the email.  You can start at

You should be able to download an evaluation copy of True DB Grid from

There has been no activity in this question in quite some time, and it looks like it has been abandoned. As part of our ongoing mission to clean up the topic areas, a Moderator will finalize this question within the next seven (7) days. At that time, either I or one of the other Moderators will force/accept the comment of agriggs.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER. If you have further comments on this question or the recommendation, please leave them here.


Some of these questions have been open for some time, and records indicate you logged in as recently as this week. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.


Community Support Moderator
Experts Exchange
Force/accepted by

Community Support Moderator
Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.