Click to See Complete Forum and Search --> : ListView Control
biot
March 7th, 2005, 05:56 PM
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.
ss_gurmeet
March 8th, 2005, 03:09 AM
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.
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:wave:
biot
March 8th, 2005, 06:17 AM
Hi, Thanks for the answer.
Another question is:
How can I track the cell that the user clicks on with its mouse?
Ronin2307
March 8th, 2005, 04:47 PM
Is this helpful?
Private Sub ListView_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView.SelectedIndexChanged
End Sub
biot
March 8th, 2005, 05:13 PM
Hi
How can I get the text of the cell's the user clicked on?
ss_gurmeet
March 9th, 2005, 03:23 AM
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:wave:
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.