Binding combo box to datatable

G

Guest

I've bound a combo box to a datatable in a dataset. I can't figure out how
to access the selected row directly. If possible, I'd like to cast it into
strongly typed datarow from my dataset:
myRow=(myDataset.MyDataTable.MyRow)cboList.Items[.selecteditem];
 
W

W.G. Ryan eMVP

You can use the Strongly types rows collection and use the index of the
combobox to specify the table index (provided they are sorted the same) and
you know the column index because that's what you're binding to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top