Completed
Last Updated: 21 Aug 2020 12:32 by ADMIN
Release R3 2020 (LIB 2020.2.826)
Paito
Created on: 23 Jun 2020 02:45
Category: GridView
Type: Bug Report
0
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?

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)
        {
            if (e.ActiveEditor is RadDropDownListEditor)
            {
                RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
                if (editor != null)
                {
                    RadDropDownListEditorElement ddlElement = (RadDropDownListEditorElement)editor.EditorElement;
                    ddlElement.EnableMouseWheel = false;

                    ddlElement.DropDownMinSize = new Size(200, 200);
                    ddlElement.AutoCompleteSuggest.DropDownList.DropDownMinSize = new Size(200, 200);

                    //ddlElement.AutoCompleteSuggest.DropDownList.Location = new Point(1000, 1000);                    
                }
            }
        }
Attached Files:
3 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 26 Jun 2020 11:21

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Paito
Posted on: 24 Jun 2020 13:48

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:

  1. Set the combobox as suggestappend
  2. Position the grid at the bottom of your screen's viewable area
  3. Give focus to the input box and begin typing to have the dropdownlist display.  The dropdownlist should cover the input field at this point.

new GridViewComboBoxColumn()

{
    Name = setting.FieldName,
    FieldName = setting.FieldName,
    HeaderText = setting.ColumnHeaderText,
    IsVisible = setting.IsVisible,
    ReadOnly = setting.ReadOnly,
    MinWidth = 150,
    SyncSelectionWithText = true,
    DropDownStyle = RadDropDownStyle.DropDown,
    ValueMember = valueMember,  //"InvoiceNumber",
    DisplayMember = displayMember, // "InvoiceNumber", //Search
    TextAlignment = ContentAlignment.MiddleLeft,
    AutoCompleteMode = AutoCompleteMode.SuggestAppend
};
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 24 Jun 2020 09:38
Hello, Paito,  

Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the below screenshot illustrating the behavior on my end with the specified version:

I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.