Larry Brister
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.SqlC onnection
Dim objCmd As New SqlClient.SqlCommand
dbCon.ConnectionString = System.Configuration.Confi gurationMa nager.AppS ettings("s trConPEP")
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
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.SqlC
Dim objCmd As New SqlClient.SqlCommand
dbCon.ConnectionString = System.Configuration.Confi
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
listPubDate.DataSource = dt
listPubDate.DataBind()
listPubDate.Items.Insert(0
Dim item As RadComboBoxItem
For Each item In listPubDate.Items
item.ToolTip = item.Text
Next item
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both were good answers. Splitting points now.