Results 1 to 3 of 3

Thread: Databinding problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Belgium
    Posts
    99

    Databinding problem

    Hello everybody,


    I have a databinding problem. I want to bind a combobox to my object or dataset.

    I first fill my combobox with my initial values and then I databind it with my object. My problem is that I always see in my selectedvalue my first value of the initial values. Not the stored value in my database !

    An example : I receive Jan, Greg, Peter

    When Peter is stored in my database, I databind my combobox to the property. The property returns me Peter but when I look at the combobox, it shows me Jan.

    Is this normal behaviour ? Do I look over something ? Or do I need to code my own selectedindex ?

    Thanks,

    Bjorn

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    What property of combubox you bind to? DispalyMember or ValueMember? I think you can not both bind and provide initial values for displaymember.
    Last edited by Lunatic3; Nov 24th, 2003 at 04:32 AM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Belgium
    Posts
    99
    Thanks for your reply but I can't get it done.

    I initialized everything and then I set my displaymember to the value but it stays at the first indexposition

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