Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1495
Select item in webcombo
posted

I am trying to select an item  based off the DataValueField in a web combo.  For some odd reason my intellisense won't work so I can't seem to figure out how to pre-select an item in the webcombo (once it has been databound).  Help would be much appreciated.

Parents
  • 19308
    posted

    You would set the value through the SelectedRow property of the WebCombo.  For example,

            Me.WebCombo1.SelectedRow = Me.WebCombo1.Rows(0)

    Be sure that the WebCombo is already databound before setting the SelectedRow, otherwise the row wont exist yet.  You can do this by using the DataBound event, or by manually calling WebCombo1.DataBind if WebCombo1.Rows.Count=0

     

Reply Children