CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2001
    Posts
    34

    ListView Control

    Hi
    I'm trying to use the ListView control in my app.
    I have question about it:
    1 - How can I get a value of specified cell (if I want to read the value of cell 3,5)?
    2 - How can I insert value to specific cell???

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    India
    Posts
    45

    Re: ListView Control

    Hi,

    its is possible in the following manner but there is requirement that cell of listview is filled before it otherwise it would not work and give an exception OutofRange.

    Code:
    ListView1.Items(2).SubItems(4).Text = "Given Entry"

    in the listview control index start from 0 so if u want to enter the value in cell 3 u must write 2 and also in subitem u must write 4 in place of 5.

    Best of luck

    Warm Regards
    Gurmeet
    Last edited by ss_gurmeet; March 10th, 2005 at 03:21 AM.

  3. #3
    Join Date
    Jun 2001
    Posts
    34

    Re: ListView Control

    Hi, Thanks for the answer.
    Another question is:
    How can I track the cell that the user clicks on with its mouse?

  4. #4
    Join Date
    Feb 2005
    Posts
    14

    Re: ListView Control

    Is this helpful?

    Code:
    Private Sub ListView_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView.SelectedIndexChanged
    
        End Sub

  5. #5
    Join Date
    Jun 2001
    Posts
    34

    Re: ListView Control

    Hi
    How can I get the text of the cell's the user clicked on?

  6. #6
    Join Date
    Mar 2005
    Location
    India
    Posts
    45

    Re: ListView Control

    Hi,
    i think this is not possible using a property of listview control. and if u still want to detect the particular cell Then u need to find out the mouse position
    and calculate as per row/column size which is not easy.

    Best of luck
    Warm Regards
    Gurmeet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured