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

SelectedValueChanged not Firing

1 Answer 165 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Saif
Top achievements
Rank 2
Saif asked on 26 May 2014, 09:36 AM
After binding MultiColumnComboBox, SelectedValueChanged excute.
But if i try to select (using keyboard or mouse) the First record which is on the Top (index 0) SelectedValueChanged doesnt work.
Then i tried to select the 2nd record and SelectedValueChanged runs. and try to select the 1st record again and SelectedValueChanged runs.

Please check this scenario.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 May 2014, 06:15 AM
Hello Saif,

Thank you for writing.

By default, the first row in the MultiColumnComboBoxElement.EditorControl is selected. When opening the popup and clicking the first row, you actually do not change the selected row as it is already selected. That is why the RadMultiColumnComboBox.SelectedValueChanged event is not fired in this case. In order to detect this situation, it is appropriate to use the MultiColumnComboBoxElement.EditorControl.CellClick event:
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorControl.CellClick += EditorControl_CellClick;

private void EditorControl_CellClick(object sender, GridViewCellEventArgs e)
{
    GridViewRowInfo selectedRow = e.Row;
}

The same situation can occur if you close the popup, pressing the Enter\Tab key without changing the selection. It is possible to handle this case as well:
this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.TextBoxControl.PreviewKeyDown +=
    TextBoxControl_PreviewKeyDown;

private void TextBoxControl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
    if (e.KeyCode == Keys.Tab || e.KeyCode == Keys.Enter)
    {
        GridViewRowInfo selectedRow = this.radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorControl.CurrentRow;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
MultiColumn ComboBox
Asked by
Saif
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or