This is a migrated thread and some comments may be shown as answers.

SelectedItem Programmatically

1 Answer 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
cayo fontana
Top achievements
Rank 1
cayo fontana asked on 09 Sep 2011, 03:24 AM
Hi Telerik,

I'm using  a RadCombobox in my application and i like to know how i can select item in code behind?
My RadCombobox is bounded thats so:
foreach (ClienteBE _cliente in this.lstCliente)
            {
                tam = _cliente.Nome.Length > tam ?
                    _cliente.Nome.Length :
                    tam;
 
                this.cmbCliente.DisplayMemberPath = "Nome";
                this.cmbCliente.Items.Add(_cliente);
            }

this.lstCliente is a list of objects.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 12 Sep 2011, 10:14 AM
Hi Cayo,

You can set either SelectedItem or SelectedIndex property of the combobox.

All the best,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
ComboBox
Asked by
cayo fontana
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or