Hi folks,
Happy new year to you all, hope you have a good one.
Problem im having here is that if i have a listview, with say 3 columns in it and say 4 rows of data and try to select one of them.
example data (excuse my dodgey columns and rows)
Ingredient - Full Bag - Part Bag
Garlic - 6 - 12
Mayo - 5 - 2
Fruit - 2 - 7
Herbs - 6 - 6
When i double click on the listview, i want to pull this information into text boxes for use by the user. I have this all firing ok with the following code
the problem im having is if i pick say the mayo row, txtPcikedIngredients.text will be fine with the mayo in it, but the txtBagsRequired.text returns the bottom row, ie 6 instead of 5.
Anyone have any ideas what im doing wrong ??
Thanks in advance
Darren
Happy new year to you all, hope you have a good one.
Problem im having here is that if i have a listview, with say 3 columns in it and say 4 rows of data and try to select one of them.
example data (excuse my dodgey columns and rows)
Ingredient - Full Bag - Part Bag
Garlic - 6 - 12
Mayo - 5 - 2
Fruit - 2 - 7
Herbs - 6 - 6
When i double click on the listview, i want to pull this information into text boxes for use by the user. I have this all firing ok with the following code
VB.NET:
Private Sub lvIngredients_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvIngredients.DoubleClick
Dim SelItems As ListView.SelectedListViewItemCollection = Me.lvIngredients.SelectedItems
txtPickedIngredient.Text = SelItems(0).SubItems(0).Text
txtBagsRequired.Text = SelItems(0).SubItems(1).Text
End Sub
the problem im having is if i pick say the mayo row, txtPcikedIngredients.text will be fine with the mayo in it, but the txtBagsRequired.text returns the bottom row, ie 6 instead of 5.
Anyone have any ideas what im doing wrong ??
Thanks in advance
Darren