RadComboBox SelectedValue don't work

1 Answer 57 Views
ComboBox
Walter
Top achievements
Rank 1
Iron
Walter asked on 28 Jan 2022, 03:05 PM

Hi Telerik's friends

I have a RadComboBox that I load with a DataTable. This is my code:

    Private Sub LoadAgente()
        Dim rcbElemento As New RadComboBoxItem

        Me.rcbAgente.DataSource = GetNombreAgente() ' Get DataTable
        Me.rcbAgente.DataValueField = "CodigoPersona"
        Me.rcbAgente.DataTextField = "NombreCompleto"
        Me.rcbAgente.DataBind()

        rcbElemento.Value = "0"
        rcbElemento.Text = "Seleccione un agente"
        Me.rcbAgente.Items.Insert(0, rcbElemento)
        rcbElemento = Nothing

        Me.rcbAgente.ClearSelection()
        Me.rcbAgente.SelectedValue = "0"
    End Sub

But this don't work.

I need your help. please.

Thanks

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Feb 2022, 06:00 PM

Hi Walter,

Please find attached a sample runnable website project which shows a working example of the SelectedValue property.

 

Regards,
Rumen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ComboBox
Asked by
Walter
Top achievements
Rank 1
Iron
Answers by
Rumen
Telerik team
Share this question
or