I have a GridViewComboBoxColumn whose autocomplete behavior is undesired upon first cell click. Users are entering in a value, but when they first try to do something their input isn't properly appending to what they type and instead appends the first suggestion entirely onto their input. Please see UndesiredBehavior.gif.
Strangely enough, if they delete everything in the cell or change it and go back to it later on, then the behavior is desired: suggestions are being appended properly to what their input is. Please see DesiredBehavior.gif.
I am having a work around right now by instructing users to CTRL + A upon first entering into the cell and then deleting whatever is appended to their first key stroke, and then typing again, but I get complaints from users that they shouldn't have to do this.
Here is my code. Any suggestions?
private void radGridViewDetail_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
if (e.ActiveEditor is RadDropDownListEditor)
{
//RadDropDownListEditor editor = (RadDropDownListEditor)e.ActiveEditor;
RadDropDownListEditor editor = this.radGridViewDetail.ActiveEditor as RadDropDownListEditor;
if (editor != null)
{
RadDropDownListEditorElement element = (RadDropDownListEditorElement)editor.EditorElement;
element.AutoCompleteSuggest.DropDownList.SelectAllText();
element.AutoCompleteSuggest.DropDownList.DropDownSizingMode = SizingMode.UpDownAndRightBottom; // This does not work
element.ArrowButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; // This works
element.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
element.AutoCompleteSuggest.DropDownList.DropDownMinSize = new Size(275, 100);
element.AutoCompleteSuggest.DropDownList.MaxLength = 30;
switch (radGridViewDetail.CurrentColumn.Name)
{
case "CO":
element.AutoCompleteSuggest.DropDownList.DropDownMinSize = new Size(100, 100);
element.AutoCompleteDataSource = companyCodeTable;
element.AutoCompleteDisplayMember = "COMP_CODE";
element.AutoCompleteValueMember = "COMP_CODE";
element.DropDownWidth = 200;
break;
case "CC":
int minimumWidth = int.Parse(costCenterTable.Rows[0]["MAX_LEN"].ToString()) * 8;
element.AutoCompleteSuggest.DropDownList.DropDownMinSize = new Size(minimumWidth, 100);
element.AutoCompleteDataSource = costCenterTable;
element.DisplayMember = "ADDRESS";
element.ValueMember = "COST_CENTER";
element.AutoCompleteDisplayMember = "ADDRESS";
element.AutoCompleteValueMember = "COST_CENTER";
break;
case "Acct":
element.AutoCompleteSuggest.DropDownList.DropDownMinSize = new Size(275, 100);
element.AutoCompleteDataSource = glMajorTable;
element.DisplayMember = "ACCT_DESC";
element.ValueMember = "GLMAJOR";
element.AutoCompleteDisplayMember = "ACCT_DESC";
element.AutoCompleteValueMember = "GLMAJOR";
break;
}
}
}
}