View Full Version : VB.NET question
Amber
04-05-2004, 12:40 AM
Hi there,
I have a very specific VB.NET problem.
I've been everywhere looking for help with this.
Is this an appropriate forum to post these types of questions?
If not, could anyone point me in the direction of another good forum for this?
Thanks
Amber
mholtum
04-05-2004, 3:59 AM
Whats the question?
I have a listview (lstvwAmend) (containing 2 columns) that is populated by a filtered dataview (dvRPA) that is based on a dataset (dsRPAmend1) pulling data from a SQL Server database.
This dataview will contain 0-10 records.
The dataview is displaying field 1 & field 2 from my dataview.
When a user clicks on one of the items in the listview, I want to set the value of a textbox on my form to equal field 3 from the same row in my dataview.
I can't seem to make this work.
I'm not sure if this is relevant, but pasted below is the code that populates my listbox:
lstvwAmend.DataBindings.Clear()
lstvwAmend.Refresh()
DsRPAmend1.Clear()
SqlDA_RPAmend.Fill(DsRPAmend1)
dvRPA = New DataView
With dvRPA
.Table = DsRPAmend1.Tables("TDT_ROAD_PERMIT_AMEND")
.RowFilter = "ID_ROAD_PERMIT = '" & txtRPID.Text & "'"
.Sort = "NUM_AMENDMENT"
End With
'create listview to display amendment number and associated CP
Dim i As Integer
lstvwAmend.Items.Clear()
lstvwAmend.Refresh()
For i = 0 To dvRPA.Count - 1
Dim LVI As New ListViewItem
LVI.Text = dvRPA.Item(i).Item(3)
If IsDBNull(dvRPA.Item(i).Item(5)) Then
Else
LVI.SubItems.Add(dvRPA.Item(i).Item(5))
End If
lstvwAmend.Items.Add(LVI)
Next
Any suggestions?
Thanks,
amber
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.