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

Select programmaticaly

5 Answers 402 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Tajes
Top achievements
Rank 1
Tajes asked on 16 Nov 2010, 05:28 PM
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.

5 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 16 Nov 2010, 05:34 PM
Hello,

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

Me.RadmultiColumnComboBox.SelectedValue = value

Let me know if you need more information
Richard
0
Tajes
Top achievements
Rank 1
answered on 17 Nov 2010, 10:01 AM
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.
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 17 Nov 2010, 10:07 AM
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
0
Martin
Top achievements
Rank 1
answered on 05 Mar 2015, 02:55 PM
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?

0
Stefan
Telerik team
answered on 06 Mar 2015, 02:44 PM
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.

 
Tags
MultiColumn ComboBox
Asked by
Tajes
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Tajes
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or