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

how to select value from multicolumn combobox??

1 Answer 401 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
mampus
Top achievements
Rank 1
mampus asked on 06 Jan 2011, 02:43 PM
Hi there....

I tried to select value from editor control then pass that to a textbox...
i'm already tried this from documentation:

    Dim test As String
    test = String.Format("Row changed, current Name = {0}", RadMultiColumnComboBox1.EditorControl.Rows(RadMultiColumnComboBox1.SelectedIndex).Cells("ContactName").Value)
textbox1.text = test

that code return me an error like this:

"Object reference not set to an instance of an object."

What should i do??

1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 10 Jan 2011, 09:40 AM
Hi mampus,

Thank you for contacting us.

The described code looks OK and it should work when there is a selected item it the control. You should also check whether the cell is empty. I modified your code slightly:
If Not RadMultiColumnComboBox1.SelectedIndex >= 0 Then
    Dim value As Object = RadMultiColumnComboBox1.EditorControl.Rows(RadMultiColumnComboBox1.SelectedIndex).Cells("ContactName").Value
    If Not value Is Nothing Then
        Dim test As String
        test = String.Format("Row changed, current Name = {0}", value)
        textbox1.text = test
    End If
End If

I hope this helps. If the issue continues to appear, please send us your application and we will try to locate it and find a suitable solution.

I am looking forward to your reply.

Best wishes,
Jack
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
MultiColumn ComboBox
Asked by
mampus
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or