comboBox SelectedValue behaviour

From: Gary Boulter (GaryBoulter_at_discussions.microsoft.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 04:55:03 -0800

hi,

I have an object populated from the database, The object has three properties,
the ID, a description, and a State

If I bind the object as a collection to a combo

comboBox.DataSourse = <objectcollection>
comboBox.DisplayMember = "description"
comboBox.ValueMember = "ID"

Regardless when I bind the objectcollection to the DataSourse property I get
the same results.

When I get the SelectedValue of the comboBox it returns the selectedIndex
value and not the expected 'ID".

Has anyone else seen this behaviour and know of a workaround

Thanks

Gary



Relevant Pages

  • RE: Drop Down List Box Asp.net (VB)
    ... try only bind the dropdownlist in the first load. ... 'Bind dropdownlist. ... I don't see any property name with selectedValue. ... post ASP.NET related problems in DotNet.Framework.aspnet. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Insane Databinding (probably a bug)
    ... SelectedValue is a property, not an attribute which is an error I would ... in my code i bind a few dropdownlist boxes's lists, ... bind the Selectedvalue property, and everything is fine. ... bright day, WITHOUT ANY CHANGE TO THE DATABINDING CODE, i started ...
    (microsoft.public.dotnet.framework.aspnet)
  • Insane Databinding (probably a bug)
    ... in my code i bind a few dropdownlist boxes's lists, ... bind the Selectedvalue property, and everything is fine. ... i have the same issue with a dropdown that has a predefined ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DropDownList properties .. no SelectedValue ...
    ... Thanks, Teemu ... ... so is there a better way to bind a DropDownList value ... I'm ignoring Intellisense and using this: ... SelectedValue in the template? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Java SQL AND OTHER ODDITIES ( general discussion)
    ... i have an address database with about 84 fields per record (mix of strings, ... data to an oracle pl/sql routine. ... // Bind any other index ...
    (comp.lang.java.programmer)