Question selecting customer id from listbox

trialer

Well-known member
Joined
Oct 4, 2010
Messages
64
Programming Experience
1-3
VB.NET:
 Private Sub lvList_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvList.DoubleClick
       [I][COLOR="lime"] 'Select Customer ID from lvList[/COLOR][/I]
        frmEdit.txtCustomerId.text = lvList.Select("Customer ID").value 
    End Sub


my code for selecting the customer id from my listbox doesn't work..
help me.
 
Your code doesn't make sense because the ListBox class doesn't have a Select method that takes a single String argument. Exactly what data is in the ListBox and exactly how did it get there in the first place? I do mean EXACTLY.
 
i've changed it too grid view,
now it's okay.

I doubt that, because the GridView is a web control. Presumably you mean DataGridView. Correct naming is important to avoid confusion. We don't know what's in your head or in your project, only what's in your posts, so they need to be accurate.

Switching from a ListBox to a DataGridView seems an odd move. The ListBox can display one column of data only. A DataGridView can be used to display one column but it seems a bit pointless. You'd really only use a grid for multiple columns.
 
Back
Top