Select programmaticaly

6 posts, 1 answers
  1. Tajes
    Tajes avatar
    81 posts
    Member since:
    Sep 2009

    Posted 16 Nov 2010 Link to this post

    Hello,

    Does anyone know how can I set the selected Item programmaticaly? 
    If I have the object that I want to select, how can I set it like selected item in the MultiColumnCombo?
    I tried to set multiColumnCombo.selectedItem = myObject but it doesn't work.

    Thanks.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Nov 2010 Link to this post

    Hello,

    You should be able to use SelectedValue. e.g.

    Me.RadmultiColumnComboBox.SelectedValue = value

    Let me know if you need more information
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Tajes
    Tajes avatar
    81 posts
    Member since:
    Sep 2009

    Posted 17 Nov 2010 Link to this post

    Hello Richard, It doesn't work. It doesn't throw any exception but after change selectedValue It doesn't occur anything. To make it works
          I set selectedIndex, using the bindingsource.indexOf(myObject). The bindingSource is the dataSource of the MulticolumnComboBox.

    Thank you anyway.
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 17 Nov 2010 Link to this post

    Hi,

    What version of the software are you using? I'm using the latest Q3 version for reference.
    Hoever, you can always loop through the records instead. For exmaple
    For Each row As GridViewRowInfo In Me.RadmultiColumnCombo.EditorControl.Rows
        If row.Cells(0).Value.ToString() = value Then
            row.IsCurrent = True
            row.IsSelected = True
            Me.ComboVatRates.Text = row.Cells(1).Value.ToString()
        End If
    Next

    hope that helps
    Richard
  6. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 05 Mar 2015 in reply to Richard Slade Link to this post

    I'm also having a problem:

    When my form loads radMultiColumnComboBoxItemType.SelectedValue = null. Which is fine.

    But if in the code if say:
    radMultiColumnComboBoxItemType.SelectedValue = 3

    The selected value still = null. I have other controls where setting the SelectedValue works fine - but here it seems to do nothing.
    Any suggestions?

  7. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 06 Mar 2015 Link to this post

    Hello Martin,

    Your question has already been answered in the other thread you've opened. Please, see our answer there for more information.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready