Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the selected data row from a ListBox

Status
Not open for further replies.

Dustman

Programmer
May 7, 2001
320
US
Ok, I know this has got to be something simple.. its a weekend though and my brain is fried. I've got a listbox bound to a table. How do I reference the actual bound DataRow of the selected row?

List box is lstProdList
Data source for the list box is qnaDS1
DisplayMember is products.pName
ValueMember is products.pid (which is the key for the row)

I need something like
Code:
dim myRow as DataRow = lstProdList.selectedItem().row

I know thats not right but thats what I need.. the actual reference to the row.

Somebody slap me for the simple question..

-Dustin
Rom 8:28
 
dim myrow as datarow = qnads1.rows(lstprodlist.selecteditem)

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
oops



Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
The only way I could get it to work was like chrissie1 said.. (with 1 extra thing)

Code:
myProduct.row = qnaDS1.[COLOR=red]Tables("Products").[/color]Rows(lstProdList.SelectedIndex)

Thanks!

-Dustin
Rom 8:28
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top