Binding combo box to datatable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob1739

    #1

    Binding combo box to datatable

    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=(myDatase t.MyDataTable.M yRow)cboList.It ems[.selecteditem];


  • W.G. Ryan eMVP

    #2
    Re: Binding combo box to datatable

    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.

    --
    W.G. Ryan, MVP

    www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
    "Bob1739" <Bob1739@discus sions.microsoft .com> wrote in message
    news:46EC7BD9-7033-4C48-92C9-7DC4A6788320@mi crosoft.com...[color=blue]
    > I've bound a combo box to a datatable in a dataset. I can't figure out[/color]
    how[color=blue]
    > to access the selected row directly. If possible, I'd like to cast it[/color]
    into[color=blue]
    > strongly typed datarow from my dataset:
    > myRow=(myDatase t.MyDataTable.M yRow)cboList.It ems[.selecteditem];
    >
    >[/color]


    Comment

    Working...