| re: listview problem
Do you have to use databinding?
Private Sub OnSelectedIndexChanged()
If myListView.SelectedItems.Count = 0 Then
txtAmend.Text = String.Empty
Else
Dim o as myDataType = CType(myListView.SelectedItems(0).Tag,
myDataType)
txtAmend.Text = o.Item(3).ToString
End If
End Sub
/claes
"amber" <anonymous@discussions.microsoft.com> wrote in message
news:9938FFCD-E156-4238-A341-AC49F3F0BB65@microsoft.com...[color=blue]
> Thanks for your help.
> I'm still doing something wrong.
> I have added the line:
> LVI.Tag = dvRPA.Item(i)
> and left the LVI.Text = dvRPA.Item(i) or else the text wouldn't display.
> So it all looks good, but the textbox still won't update.
> My code for the SelectedIndexChanged event is:
> Me.txtAmend.DataBindings.Clear()
> Me.txtAmend.DataBindings.Add("text", dvRPA, "ID_ROAD_PERMIT_AMEND")
> my dataview (dvRPA) is declared at the class level.
>
> I do this exact same thing with my listboxes, with the exact same code,[/color]
and it works great, but with my listview,[color=blue]
> when the listview item is selected, no matter how many items there are, or[/color]
which one is selected,[color=blue]
> the textbox (txtAmend) is always populated with the item that is[/color]
associated with the first item in the listview.[color=blue]
>
> Any ideas?
>
> Thanks,
> Amber[/color] |