Esempio n. 1
0
        protected override bool BeginMeasure(SizeF availableSize)
        {
            RadListElement parent = this.Parent as RadListElement;

            if (parent != null && parent.AutoSizeItems)
            {
                this.SuspendThemeRefresh();
                bool  flag = false;
                float num  = 0.0f;
                if (this.ElementTree != null)
                {
                    DropDownPopupForm control = this.ElementTree.Control as DropDownPopupForm;
                    if (control != null)
                    {
                        num = control.OwnerDropDownListElement.DesiredSize.Width;
                    }
                }
                foreach (RadListDataItem data in (IEnumerable <RadListDataItem>)parent.Items)
                {
                    if ((double)this._previousAvailableSize.Width != (double)availableSize.Width || data.measureDirty)
                    {
                        float      width      = (double)availableSize.Width == 0.0 ? num : availableSize.Width;
                        RadElement radElement = this.UpdateElement(data is DescriptionTextListDataItem ? 1 : 0, data) as RadElement;
                        if (radElement != null)
                        {
                            radElement.InvalidateMeasure(true);
                            radElement.Measure(parent.FitItemsToSize ? new SizeF(width, float.PositiveInfinity) : LayoutUtils.InfinitySize);
                            flag |= data.MeasuredSize != radElement.DesiredSize;
                            data.MeasuredSize = radElement.DesiredSize;
                        }
                    }
                }
                if (flag)
                {
                    parent.Scroller.UpdateScrollRange();
                }
                this.ResumeThemeRefresh();
            }
            this._previousAvailableSize = availableSize;
            return(base.BeginMeasure(availableSize));
        }
 public RadDropDownPopupFormAccessibleObject(DropDownPopupForm form)
     : base(form)
 {
     form.OwnerDropDownListElement.ListElement.SelectedIndexChanged += new PositionChangedEventHandler(ListElement_SelectedIndexChanged);
 }
 public RadDropDownPopupFormAccessibleObject(DropDownPopupForm form)
     : base((Control)form)
 {
     form.OwnerDropDownListElement.ListElement.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(this.ListElement_SelectedIndexChanged);
 }