public DetailListViewDataCellElement(DetailListViewVisualItem owner, ListViewDetailColumn column)
     : base(column)
 {
     this.row = owner;
     this.BindProperty(DetailListViewDataCellElement.SelectedProperty, owner, DetailListViewVisualItem.SelectedProperty, PropertyBindingOptions.OneWay);
     this.BindProperty(DetailListViewDataCellElement.CurrentRowProperty, owner, DetailListViewVisualItem.CurrentProperty, PropertyBindingOptions.OneWay);
 }
 public DetailListViewDataCellElement(
     DetailListViewVisualItem owner,
     ListViewDetailColumn column)
     : base(column)
 {
     this.row = owner;
     int num1 = (int)this.BindProperty(DetailListViewDataCellElement.SelectedProperty, (RadObject)owner, BaseListViewVisualItem.SelectedProperty, PropertyBindingOptions.OneWay);
     int num2 = (int)this.BindProperty(DetailListViewDataCellElement.CurrentRowProperty, (RadObject)owner, BaseListViewVisualItem.CurrentProperty, PropertyBindingOptions.OneWay);
 }
        protected virtual float CalculateColumnWidth(
            ListViewDetailColumn column,
            ListViewBestFitColumnMode mode)
        {
            IVirtualizedElementProvider <ListViewDataItem> elementProvider = this.DetailListView.Scroller.ElementProvider;
            float val1 = 0.0f;

            if (mode == ListViewBestFitColumnMode.HeaderCells || mode == ListViewBestFitColumnMode.AllCells)
            {
                DetailListViewHeaderCellElement element = this.DetailListView.ColumnScroller.ElementProvider.GetElement(column, (object)null) as DetailListViewHeaderCellElement;
                this.DetailListView.ColumnContainer.Children.Add((RadElement)element);
                element.Attach(column, (object)null);
                element.ResetLayout(true);
                val1 = Math.Max(val1, this.GetCellDesiredWidth((DetailListViewCellElement)element));
                this.DetailListView.ColumnContainer.Children.Remove((RadElement)element);
                this.Detach(this.DetailListView.ColumnScroller.ElementProvider, (DetailListViewCellElement)element);
                if (mode == ListViewBestFitColumnMode.HeaderCells)
                {
                    return(val1);
                }
            }
            IEnumerator <ListViewDataItem> enumerator = (IEnumerator <ListViewDataItem>)null;

            if (mode == ListViewBestFitColumnMode.DataCells || mode == ListViewBestFitColumnMode.AllCells)
            {
                enumerator = (IEnumerator <ListViewDataItem>) new ListViewTraverser(this.DetailListView.Owner);
            }
            enumerator.Reset();
            while (enumerator.MoveNext())
            {
                ListViewDataItem current = enumerator.Current;
                if (this.CanBestFitItem(current))
                {
                    DetailListViewVisualItem element1 = elementProvider.GetElement(current, (object)null) as DetailListViewVisualItem;
                    element1.Attach(current, (object)null);
                    this.DetailListView.ColumnContainer.Children.Add((RadElement)element1);
                    IVirtualizedElementProvider <ListViewDetailColumn> cellElementProvider = (IVirtualizedElementProvider <ListViewDetailColumn>) new DetailListViewDataCellElementProvider(element1);
                    DetailListViewCellElement element2 = cellElementProvider.GetElement(column, (object)element1) as DetailListViewCellElement;
                    element1.Children.Add((RadElement)element2);
                    element2.Attach(column, (object)element1);
                    element2.ResetLayout(true);
                    val1 = Math.Max(val1, this.GetCellDesiredWidth(element2));
                    element1.Children.Remove((RadElement)element2);
                    this.DetailListView.ColumnContainer.Children.Remove((RadElement)element1);
                    this.Detach(cellElementProvider, element2);
                    this.Detach(elementProvider, element1);
                }
            }
            return(val1);
        }
        private void CalculateCornerCellWidth()
        {
            cornerCellWidth = 0;

            foreach (RadElement element in this.ViewElement.Children)
            {
                DetailListViewVisualItem visualItem = (element as DetailListViewVisualItem);

                if (visualItem != null)
                {
                    cornerCellWidth = Math.Max(visualItem.ToggleElement.DesiredSize.Width, cornerCellWidth);
                }
            }
        }
Example #5
0
        protected virtual float CalculateCornerCellWidth()
        {
            float val2 = this.ViewElement.Children.Count != 0 || !this.Owner.ShowCheckBoxes ? 0.0f : 16f;

            foreach (RadElement child in this.ViewElement.Children)
            {
                DetailListViewVisualItem listViewVisualItem = child as DetailListViewVisualItem;
                if (listViewVisualItem != null)
                {
                    val2 = Math.Max(listViewVisualItem.ToggleElement.DesiredSize.Width, val2);
                }
            }
            return(val2);
        }
 private void Detach(
     IVirtualizedElementProvider <ListViewDataItem> itemElementProvider,
     DetailListViewVisualItem item)
 {
     if (item != null)
     {
         itemElementProvider.CacheElement((IVirtualizedElement <ListViewDataItem>)item);
         item.Detach();
         if (item.Parent == null || !item.Parent.Children.Contains((RadElement)item))
         {
             return;
         }
         item.Parent.Children.Remove((RadElement)item);
     }
     else
     {
         item.Dispose();
     }
 }
Example #7
0
 public DetailListViewDataCellElementProvider(DetailListViewVisualItem owner)
 {
     this.owner = owner;
 }