Excel Addin hangs when MCCB is scrolled

4 posts, 2 answers
  1. Christian
    Christian avatar
    44 posts
    Member since:
    May 2012

    Posted 04 May 2018 Link to this post

    Hi,

    I've a problem (again) when the MCCB is used in an Excel addin environment.

    If the MCCB is used on a normal form (non modal) and you scroll (mouse wheel) inside the dropdown (grid) then the complete addin hangs.

    If you do the same in an modal form, everything works fine.

    Sample project is attached (rename to zip)

    Steps to reproduce:

        button2 -> opens modal form (OK)
        button1 -> opens non modal form (not OK)
        open dropdown and then scroll inside grid with mouse wheel

    Is there any workaround? (even if I have to disable mouse scrolling, would be better than an hanging application)

     

     

     

     

     

     

     

     

     

     

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2763 posts

    Posted 07 May 2018 Link to this post

    Hello Christian,

    I have logged this for investigation in our backlog. You can track its progress, subscribe to status changes and add your comment to it here. I have also updated your Telerik Points.

    This is caused by how the layout is updated when the scroll is performed inside a drop down. To workaround this you need to create a custom popup form and override the OnMouseWheel event. Here is the code (the other classes are needed for replacing the default popup):
    class MyMultiColumnComboPopupForm : MultiColumnComboPopupForm
    {
        public MyMultiColumnComboPopupForm(PopupEditorBaseElement owner)
           : base(owner)
        {
     
        }
        public override bool OnMouseWheel(Control target, int delta)
        {
            return true;
        }
    }
    class MyMCCB : RadMultiColumnComboBox
    {
        protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()
        {
            return new MyMCCBElement();
        }
    }
    class MyMCCBElement : RadMultiColumnComboBoxElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(RadMultiColumnComboBoxElement);
            }
        }
        protected override RadPopupControlBase CreatePopupForm()
        {
            var popupForm = new MyMultiColumnComboPopupForm(this);
            popupForm.EditorControl.Focusable = false;
            popupForm.MinimumSize = this.DropDownMaxSize;
            popupForm.MaximumSize = this.DropDownMaxSize;
            popupForm.Height = this.DropDownHeight;
            popupForm.VerticalAlignmentCorrectionMode = AlignmentCorrectionMode.SnapToOuterEdges;
            popupForm.HorizontalAlignmentCorrectionMode = AlignmentCorrectionMode.Smooth;
            popupForm.RightToLeft = this.RightToLeft ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.Inherit;
            this.WirePopupFormEvents(popupForm);
            return popupForm;
        }
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Christian
    Christian avatar
    44 posts
    Member since:
    May 2012

    Posted 08 May 2018 in reply to Dimitar Link to this post

    Hello Dimitar,

    thanks for the workaround.

    I've noticed another problem, but not as bad as the scroll bug. If you open the dropdown (by clicking on the arrow), close it and then reopen it, the dropdown flickers and sometimes closes it self (without calling the close... events). This is also a modal/non modal problem. It's reproducible with the same test project from my initial post.

     

  4. Answer
    Dimitar
    Admin
    Dimitar avatar
    2763 posts

    Posted 08 May 2018 Link to this post

    Hi Christian,

    I was able to reproduce this as well. It is caused by the animation. Here is how you can disable it:
    radMultiColumnComboBox1.MultiColumnComboBoxElement.DropDownAnimationEnabled = false;

    Let me know if I can assist you further.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top