Results 1 to 7 of 7

Thread: databinding to combo

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    databinding to combo

    how do you get a combo box to show a selected index compared to the value store in the database via databinding.....

    my binding code

    VB Code:
    1. Me.cboIndexPeriod.DataBindings.Add(New System.Windows.Forms.Binding("Text", MyDataSource, "Table.SpiderPeriod"))

    contain int value i have a combo displaying values from table a

    0, Weekly
    1, monthly

    i wana display the text value depending on the value in my dataset. this int value is the fk to the table that displays in the combo


    hope this makes sense
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    bump
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  3. #3

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    bump bump anybody ?
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  4. #4

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    Let me rephase my queston

    How do you display a combo box depending on its data member, IE i have a form which navigates records in my dataset.

    the values in a certain column can be anything 0 to 4

    my combo box is populated with

    weekly
    fortnightly
    monthly
    quaterly
    yearly

    my databinding will return a number and then i want to use index of to display the correct period, how is this done ?
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  5. #5
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Sorry, I still don't get what you're trying to do. You say you've got the number 0 - 4, and the selecteditem from the combobox. Are you trying to associate the number with the selecteditem? get the selectedindex of the selecteditem? Not sure what you want.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Wouldn't it be easier to just inner join in your query that you are using for the datasource. That would allow you to bind the display and value to the two fields in your source. Otherwise you have to set a relationship in the dataset after loading it and fidget about with that whole thing.

  7. #7

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    I like your thinking Edneeis

    Sorry having bit of a DOH weekend, too much sun, (for once)
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

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