Hi, I have an UltraCombo bound to an UltraGrids cell. While the cell is multiline, my users can edit a good portion of text in the cell. When using the ultracombo the users can select a string from a list of strings. This string will be copied into the cell and the users can edit this text. Now - when the users tries to navigate through the edited text with the arrow keys, he actually navigates through the ultracombos entries and the edited text is replaced by the string selected from the combox in an instant. How can i prevent the ultracombo from scrolling through the rows when hitting arrow keys?
Thanks for all helpful answers.
Hello,
A possible approach to achieve this might be by using the following code sample:
private void ultraGrid1_KeyDown(object sender, KeyEventArgs e) { if (ultraGrid1.ActiveCell.Column.Key == "Column 0") { if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) { e.Handled = true; } } }
Please feel free to let me know if I misunderstood you or if you have any other questions.
Hi,
thanks for your answer. The good thing is, the solution will prevent, that the user accidentially overwrites the edited text. The bad thing is, he can't navigate through the edited text with arrow keys. What would be the perfect solution.
Can I handle the keydown event for the arrow keys in the way, that the cursor switches the lines within the editorcomponent but without letting the ultracombo select the next row?