Completed
Last Updated: 17 Sep 2015 11:01 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 02 Sep 2015 08:22
Category: GridView
Type: Bug Report
1
FIX. RadGridView/RadPropertyGrid - RadDropDownListEditor/PropertyGridDropDownListEditor should move the caret position when pressing left/right arrow keys in RadDropDownStyle.DropDown
Workaround: handle the KeyDown event of the inner TextBoxControl and manipulate the TextBox.SelectionStart:

private void radPropertyGrid1_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridDropDownListEditor ddlEditor = e.Editor as PropertyGridDropDownListEditor;
    if (ddlEditor != null)
    {
        ddlEditor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
        BaseDropDownListEditorElement el = ddlEditor.EditorElement as BaseDropDownListEditorElement;
        el.EditableElement.TextBox.TextBoxItem.TextBoxControl.KeyDown -= el_KeyDown;
        el.EditableElement.TextBox.TextBoxItem.TextBoxControl.KeyDown += el_KeyDown;
    }
}

private void el_KeyDown(object sender, KeyEventArgs e)
{
    TextBox tb = sender as TextBox;
    if (e.KeyData == Keys.Left && tb.SelectionStart > 0)
    {
        tb.SelectionStart = --tb.SelectionStart;
    }
    if (e.KeyData == Keys.Right && tb.SelectionStart <= tb.Text.Length)
    {
        tb.SelectionStart = ++tb.SelectionStart;
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
2 comments
ADMIN
Stefan
Posted on: 09 Sep 2015 11:37
HI Eunsik,

I completely agree with you. This is an issue and we will resolve it accodingly.
Eunsik
Posted on: 03 Sep 2015 00:41
I think that the feature should be the basic behavior of PropertyGridDropDownListEditor control as like basic behavior of WinForm controls.