SelectedItem Programmatically

2 posts, 0 answers
  1. cayo fontana
    cayo fontana avatar
    9 posts
    Member since:
    Mar 2010

    Posted 08 Sep 2011 Link to this post

    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.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 12 Sep 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top