Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

T0D0

@T0D0
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • comboBox.SelectedItem/Index
    T T0D0

    Hi, thanks for the reply. Try chaning this code part, I get the the first Washington selected. // Populates the list box using DataSource. // DisplayMember is used to display just the long name of each state. ArrayList USStates = new ArrayList(); USState defaultSelection = new USState("Washington", "W1"); //New USStates.Add(new USState("Alabama", "AL")); USStates.Add(new USState("Washington", "WA")); USStates.Add(defaultSelection); // Duplicate DisplayMember //Changed USStates.Add(new USState("West Virginia", "WV")); USStates.Add(new USState("Wisconsin", "WI")); // Duplicate DisplayMember USStates.Add(new USState("Wisconsin", "W1")); USStates.Add(new USState("Wyoming", "WY")); ListBox1.SelectedValueChanged += new EventHandler(ListBox1_SelectedValueChanged); ListBox1.DataSource = USStates; ListBox1.DisplayMember = "LongName"; ListBox1.ValueMember = "ShortName"; ListBox1.SelectedItem = defaultSelection; //New Regards,

    ToDo

    .NET (Core and Framework) database help question

  • comboBox.SelectedItem/Index
    T T0D0

    Hi, I've got a combobox to which I add objects. I would like to have one specifiec object selected. Some of the objects contain the same DisplayMember but differ in other aspects = index. When the objects that do not have dublicates are selected there is no problem in selecting correct item as selected, but when the object has DisplayMember dublicates the first displayed items is always selected no matter what SelectedIndex or SelectedItem is assigned. Any tip?

    ToDo

    .NET (Core and Framework) database help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups