Results 1 to 5 of 5

Thread: [RESOLVED] [2008] Binding combobox question

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Constanta,Romania
    Posts
    71

    Resolved [RESOLVED] [2008] Binding combobox question

    Hi !
    I have a table

    table1
    id (numeric)
    ...
    id_invalid (numeric)
    ......

    Field id_invalid could have 3 values
    0 - Normal
    1 -Gr.1
    2 -Gr.2
    This field in no FK,I have no table defined for these values,I use one combobox to select them,combo is bound this way to a temporary source :
    vb.net Code:
    1. Dim wDtbl As New DataTable
    2.         wDtbl.Columns.Add("id", GetType(Integer))
    3.         wDtbl.Columns.Add("exp", GetType(String))
    4.         Dim wdrwItem As DataRow
    5.         wdrwItem = wDtbl.NewRow
    6.         wdrwItem("id") = 0
    7.         wdrwItem("exp") = "Normal"
    8.         wDtbl.Rows.Add(wdrwItem)
    9.         wdrwItem = wDtbl.NewRow
    10.         wdrwItem("id") = 1
    11.         wdrwItem("exp") = "Gr.1"
    12.         wDtbl.Rows.Add(wdrwItem)
    13. ................................
    14.         comInvl.DisplayMember = "exp"
    15.         comInvl.ValueMember = "id"
    16.         comInvl.DataSource = wDtbl
    I get selected id using SelectedValue and write it to id_invalid field in table1

    My problem is : can I bind my combobox to display exp from wDtbl when I navigate into table1 ?

    Thanks !
    Last edited by ionut_y; May 2nd, 2008 at 02:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width