001.png: On the GridViewComboBoxColumn how do I prevent the drop down from covering the input cell when grid is at the bottom of the screen's viewable area?
I've tried setting the position and location under the CellEditorInitialized event, but had no luck.
private void RadGridARCashReceipt_CellEditorInitialized(object sender, GridViewCellEventArgs e)
Hello, Paito,
Thank you for the provided clarification.
With the following changes I was able to replicate the undesired overlapping of the autocomplete popup with the editable area. The attached AutoCompleteDropDown.gif illustrates the incorrect behavior:
this.radGridView1.DataSource = this.productsBindingSource;
GridViewComboBoxColumn combCol = new GridViewComboBoxColumn("Category");
combCol.DataSource = this.categoriesBindingSource;
combCol.ValueMember = "CategoryID";
combCol.DisplayMember = "CategoryName";
combCol.FieldName = "CategoryID";
combCol.DropDownStyle = RadDropDownStyle.DropDown;
combCol.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
combCol.Width = 200;
this.radGridView1.Columns.Insert(0,combCol);
this.radGridView1.AddNewRowPosition = SystemRowPosition.Bottom;
I have logged it in our feedback portal by making this thread public on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.
I have also updated your Telerik points.
Currently, the possible solution that I can suggest is to use the following custom implementation for the AutoCompleteSuggestHelper:
public RadForm1()
{
InitializeComponent();
this.radGridView1.CellEditorInitialized += RadGridView1_CellEditorInitialized;
}
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
RadDropDownListEditor ddl = e.ActiveEditor as RadDropDownListEditor;
if (ddl!=null)
{
RadDropDownListEditorElement el = ddl.EditorElement as RadDropDownListEditorElement;
el.AutoCompleteSuggest = new CustomAutoCompleteSuggestHelper(el);
}
}
public class CustomAutoCompleteSuggestHelper : AutoCompleteSuggestHelper
{
public CustomAutoCompleteSuggestHelper(RadDropDownListElement owner) : base(owner)
{
}
protected override RadDropDownListElement CreateDropDownElement()
{
return new CustomAutoCompleteSuggestDropDownListElement(this);
}
}
public class CustomAutoCompleteSuggestDropDownListElement : AutoCompleteSuggestDropDownListElement
{
private AutoCompleteSuggestHelper owner;
public CustomAutoCompleteSuggestDropDownListElement(AutoCompleteSuggestHelper owner) : base(owner)
{
this.owner = owner;
}
protected override Point GetPopupLocation(RadPopupControlBase popup)
{
Point ddlLocation = this.owner.Owner.ControlBoundingRectangle.Location;
Point screenLocation = this.owner.Owner.ElementTree.Control.PointToScreen(ddlLocation);
int screenHeight = Screen.PrimaryScreen.WorkingArea.Height;
if (screenHeight > screenLocation.Y + popup.Height + this.owner.Owner.ControlBoundingRectangle.Height)
{
screenLocation.Y += this.owner.Owner.ControlBoundingRectangle.Height;
}
return screenLocation;
}
}
The provided DropDownFixedLocation.gif demonstrates the achieved result.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Thanks for the quick response and I apologize for the lack of details on my initial request. This is an autocomplete with a mode of suggestappend. The issue becomes apparent when you start typing in the input box (where the dropdownlist is drawn) and not when you drill down via the arrow click.
To reproduce:
new GridViewComboBoxColumn()
{Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik