Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Combobox to Textbox

Good morning,
  I have a combobox on an ascx page that is populating fine from the ascx.vb page.

I need to populate a textbox on the same page with the selected value from the combobox.


the textbox name is CurrentPubDate .
the combobox name and code is below


Private Sub loadPubDate()
        Dim dbCon As New System.Data.SqlClient.SqlConnection
        Dim objCmd As New SqlClient.SqlCommand
        dbCon.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("strConPEP")
        dbCon.Open()
        Dim adapter As New SqlDataAdapter("SELECT CONVERT(VARCHAR(10), datSunday, 101) as datSunday FROM getSunday", dbCon)
        Dim dt As New DataTable()
        adapter.Fill(dt)
        dbCon.Close()
        listPubDate.DataTextField = "datSunday"
        listPubDate.DataValueField = "datSunday"
        listPubDate.DataSource = dt
        listPubDate.DataBind()
        listPubDate.Items.Insert(0, New RadComboBoxItem(""))

        Dim item As RadComboBoxItem

        For Each item In listPubDate.Items
            item.ToolTip = item.Text
        Next item
    End Sub

SOLUTION
Avatar of vbandaru
vbandaru

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Larry Brister

ASKER

Hey folks,
  Both were good answers.  Splitting points now.