Imports System.Data.SqlClient
Imports System.Data
Imports Telerik.Web.UI

Partial Class VB_Examples_SelectedValue
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

        If Not IsPostBack Then
            Dim sqlSelectCommand As String = "SELECT [CustomerID] ,[CompanyName] ,[ContactName]  ,[ContactTitle]  FROM [Northwind].[dbo].[Customers]"

            Dim adapter As New SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings("NorthwindConnectionString2").ConnectionString)
            Dim dataTable As New DataTable()
            adapter.Fill(dataTable)

            RadComboBox1.DataValueField = "CustomerID"
            RadComboBox1.DataTextField = "CompanyName"
            RadComboBox1.DataSource = dataTable
            RadComboBox1.DataBind()

        End If
    End Sub
    Protected Sub RadComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
        Dim s1 As String = Me.RadComboBox1.SelectedValue
        Dim s2 As String = e.Value
        Me.lblSelectedValue.Text = "Me.RadComboBox1.SelectedValue: " & s1 & " e.Value:" & s2

        ' this code works too
        'Dim s As String

        's = e.Value
        's = RadComboBox1.SelectedValue
        'Me.lblSelectedValue.Text = s

    End Sub

End Class
