setting a default value for a combo box...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brad Pears

    #1

    setting a default value for a combo box...

    In my vb.net 2005 project I have a few combo boxes where I want to set a
    default value. I am not binding these combo boxes - I am loading the values
    directly in code from a dataset.

    Obviously the default I am settign will be one of the values from teh drop
    down list..

    How do you set a default value for a combo box??

    Thanks, Brad


  • Brad Pears

    #2
    Re: setting a default value for a combo box...

    PS... If I try to set the text property, whatever I type in there is
    erased... This is what I thought I would have to do to set a default...

    Brad
    "Brad Pears" <bradp@truenort hloghomes.comwr ote in message
    news:eniV5mI0HH A.5152@TK2MSFTN GP02.phx.gbl...
    In my vb.net 2005 project I have a few combo boxes where I want to set a
    default value. I am not binding these combo boxes - I am loading the
    values directly in code from a dataset.
    >
    Obviously the default I am settign will be one of the values from teh drop
    down list..
    >
    How do you set a default value for a combo box??
    >
    Thanks, Brad
    >

    Comment

    • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

      #3
      Re: setting a default value for a combo box...

      Brad,

      If the combo box contains strings, you can set the SelectedItem property to
      one of the strings to select it.

      Or you can set the SelectedIndex property to the zero-based index of the
      item to be selected.

      Keep in mind that selecting a default value will have the side effect of
      causing the SelectedIndexCh anged event to fire.

      Kerry Moorman


      "Brad Pears" wrote:
      PS... If I try to set the text property, whatever I type in there is
      erased... This is what I thought I would have to do to set a default...
      >
      Brad
      "Brad Pears" <bradp@truenort hloghomes.comwr ote in message
      news:eniV5mI0HH A.5152@TK2MSFTN GP02.phx.gbl...
      In my vb.net 2005 project I have a few combo boxes where I want to set a
      default value. I am not binding these combo boxes - I am loading the
      values directly in code from a dataset.

      Obviously the default I am settign will be one of the values from teh drop
      down list..

      How do you set a default value for a combo box??

      Thanks, Brad
      >
      >
      >

      Comment

      Working...