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

NullReferenceException

2 Answers 87 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Abbas
Top achievements
Rank 1
Abbas asked on 09 Mar 2015, 04:26 PM
Hello dear Dimitar,

There is a amazing program which has been developed by you. "Use custom filtering to search in all columns of RadMultiColumnComboBox".
http://www.telerik.com/support/kb/details/use-custom-filtering-to-search-in-radmulticolumncombobox
It is very good, handy and really wow.
But when you hit enter key on MultiColumnComboBox for 3 times, you get an NullReferenceException exception.
Can you fix it?

Thanks
Regards,
Abbas

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 11 Mar 2015, 03:21 PM
Hi Abbas,

Thank you for writing.

I was able to reproduce the observed exception. To avoid this behavior you can handle the enter key only when the popup is shown:
void radMultiColumnComboBox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == System.Windows.Forms.Keys.Enter && radMultiColumnComboBox1.MultiColumnComboBoxElement.IsPopupOpen)
    {
        if (this.radMultiColumnComboBox1.ValueMember != "")
        {
            radMultiColumnComboBox1.SelectedValue = radMultiColumnComboBox1.EditorControl.CurrentRow.Cells[radMultiColumnComboBox1.ValueMember].Value;
        }
        else
        {
            radMultiColumnComboBox1.SelectedValue = radMultiColumnComboBox1.EditorControl.CurrentRow.Cells[radMultiColumnComboBox1.DisplayMember].Value;
        }
 
        radMultiColumnComboBox1.Text = radMultiColumnComboBox1.EditorControl.CurrentRow.Cells[radMultiColumnComboBox1.DisplayMember].Value.ToString();
        radMultiColumnComboBox1.MultiColumnComboBoxElement.ClosePopup();
        radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.SelectAll();
    }
 
}

I will fix this in the article as soon as possible. I have updated your Telerik Points for this report.
 
Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
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.

 
0
Abbas
Top achievements
Rank 1
answered on 12 Mar 2015, 07:56 AM
Hi dear Dimitar,

I really appreciate your help and support.

Thanks,
Regards,
Abbas
Tags
MultiColumn ComboBox
Asked by
Abbas
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Abbas
Top achievements
Rank 1
Share this question
or