Example #1
0
        public override int GetRowHeight(GridViewRowInfo rowInfo)
        {
            GridViewDetailsRowInfo viewDetailsRowInfo = rowInfo as GridViewDetailsRowInfo;

            if (viewDetailsRowInfo != null && viewDetailsRowInfo.ActualHeight != -1)
            {
                return(viewDetailsRowInfo.ActualHeight);
            }
            if (rowInfo is GridViewTableHeaderRowInfo)
            {
                if (!this.Owner.GridViewElement.AutoSizeRows || rowInfo.Height == -1)
                {
                    return((int)this.DesiredSize.Height);
                }
                return(rowInfo.Height);
            }
            if (rowInfo.Height != -1)
            {
                return(Math.Max(rowInfo.Height, rowInfo.MinHeight));
            }
            if (rowInfo is GridViewGroupRowInfo)
            {
                return(this.Owner.GroupHeaderHeight);
            }
            return((int)this.tree.ColumnRowsTotalHeight);
        }
 protected override int FindCompatibleElement(int position, GridViewRowInfo data)
 {
     if (data is GridViewFilteringRowInfo)
     {
         for (int index = position + 1; index < this.Children.Count; ++index)
         {
             if ((object)((GridRowElement)this.Children[index]).RowInfo.GetType() == (object)data.GetType())
             {
                 return(index);
             }
         }
     }
     if (data is GridViewDetailsRowInfo)
     {
         for (int index = position + 1; index < this.Children.Count; ++index)
         {
             GridViewDetailsRowInfo rowInfo = ((GridRowElement)this.Children[index]).RowInfo as GridViewDetailsRowInfo;
             if (rowInfo != null && ((GridViewDetailsRowInfo)data).ChildViewInfo == rowInfo.ChildViewInfo)
             {
                 return(index);
             }
         }
     }
     return(-1);
 }
Example #3
0
        public virtual bool EnsureRowVisible(GridViewRowInfo rowInfo)
        {
            if (rowInfo.ViewInfo != this.ViewInfo || rowInfo.ViewInfo == this.MasterViewInfo && rowInfo.PinPosition != PinnedRowPosition.None || (!this.TableElement.ElementTree.Control.Visible && !(this.TableElement.ElementTree.Control is MultiColumnComboGridView) || (this.TableElement.ElementTree.Control.Size == Size.Empty || (SizeF)this.TableElement.Size == SizeF.Empty)))
            {
                return(false);
            }
            if (this.TableElement.MasterTemplate != null && this.TableElement.MasterTemplate.EnablePaging)
            {
                int pageIndex = this.TableElement.MasterTemplate.PageIndex;
                if (this.TableElement.MasterTemplate.EnableGrouping && this.TableElement.MasterTemplate.GroupDescriptors.Count > 0)
                {
                    int         num        = -2;
                    IEnumerator enumerator = (IEnumerator) new PagedGroupedTraverser(((RadDataView <GridViewRowInfo>) this.TableElement.MasterTemplate.DataView).GroupBuilder.Groups.GroupList);
                    while (enumerator.MoveNext())
                    {
                        GridViewGroupRowInfo current = enumerator.Current as GridViewGroupRowInfo;
                        if (current != null && current.GroupLevel == 0)
                        {
                            ++num;
                        }
                        if (enumerator.Current == rowInfo)
                        {
                            break;
                        }
                    }
                    if (num >= 0)
                    {
                        pageIndex = num / this.TableElement.MasterTemplate.PageSize;
                    }
                }
                else
                {
                    pageIndex = this.TableElement.ViewTemplate.DataView.GetItemPage(rowInfo);
                }
                if (pageIndex != this.TableElement.MasterTemplate.PageIndex && !(rowInfo is GridViewNewRowInfo))
                {
                    this.TableElement.MasterTemplate.MoveToPage(pageIndex);
                    this.TableElement.ViewElement.UpdateRows(true);
                    if (this.TableElement.GridViewElement != null)
                    {
                        this.GridViewElement.PagingPanelElement.UpdateView();
                    }
                }
            }
            this.UpdateLayout();
            GridViewDetailsRowInfo viewDetailsRowInfo = rowInfo as GridViewDetailsRowInfo;

            if (viewDetailsRowInfo == null)
            {
                return(this.EnsureRowVisibleCore(rowInfo));
            }
            RadScrollBarElement vScrollBar = this.UseScrollbarsInHierarchy ? this.VScrollBar : this.MasterVScrollBar;

            if (this.GetRowElement((GridViewRowInfo)viewDetailsRowInfo) is GridDetailViewRowElement || !this.EnsureRowVisibleByTraverser(vScrollBar, (GridViewRowInfo)viewDetailsRowInfo, (float)vScrollBar.SmallChange))
            {
                return(false);
            }
            this.UpdateLayout();
            return(true);
        }
Example #4
0
 public GridViewHierarchyRowInfo(GridViewInfo owner)
     : base(owner)
 {
     if (this.ViewTemplate.Templates.Count <= 0)
     {
         return;
     }
     this.childRow = this.CreateGridViewDetailsRowInfo(this);
 }
Example #5
0
        public override bool IsCompatible(GridViewRowInfo data, object context)
        {
            GridViewDetailsRowInfo viewDetailsRowInfo = data as GridViewDetailsRowInfo;

            if (this.ViewInfo == null || viewDetailsRowInfo == null)
            {
                return(data is GridViewDetailsRowInfo);
            }
            GridViewDetailsRowInfo rowInfo = this.RowInfo as GridViewDetailsRowInfo;

            return(viewDetailsRowInfo.ChildViewInfo == rowInfo.ChildViewInfo);
        }
Example #6
0
        public virtual int GetRowHeight(GridViewRowInfo rowInfo)
        {
            GridViewDetailsRowInfo viewDetailsRowInfo = rowInfo as GridViewDetailsRowInfo;

            if (viewDetailsRowInfo != null && viewDetailsRowInfo.ActualHeight != -1)
            {
                return(viewDetailsRowInfo.ActualHeight);
            }
            int val1 = rowInfo.Height;

            if (val1 < 1)
            {
                val1 = !(rowInfo is GridViewTableHeaderRowInfo) ? (!(rowInfo is GridViewFilteringRowInfo) ? (!(rowInfo is GridViewSearchRowInfo) ? (!(rowInfo is GridViewDetailsRowInfo) ? (!(rowInfo is GridViewGroupRowInfo) ? this.Owner.RowHeight : this.Owner.GroupHeaderHeight) : this.Owner.ChildRowHeight) : this.Owner.SearchRowHeight) : this.Owner.FilterRowHeight) : this.Owner.TableHeaderHeight;
            }
            return(Math.Max(val1, 1));
        }
Example #7
0
        public override int GetRowHeight(GridViewRowInfo rowInfo)
        {
            GridViewDetailsRowInfo viewDetailsRowInfo = rowInfo as GridViewDetailsRowInfo;

            if (viewDetailsRowInfo != null && viewDetailsRowInfo.ActualHeight != -1)
            {
                return(viewDetailsRowInfo.ActualHeight);
            }
            if (rowInfo.Height != -1)
            {
                return(rowInfo.Height);
            }
            if (rowInfo is GridViewGroupRowInfo)
            {
                return(this.Owner.GroupHeaderHeight);
            }
            return((int)this.desiredSize.Height);
        }
        protected override void RemoveElement(int position)
        {
            RadGridViewElement gridViewElement = ((RowsContainerElement)this.Parent).TableElement.GridViewElement;
            BaseGridEditor     activeEditor    = gridViewElement.ActiveEditor as BaseGridEditor;

            if (gridViewElement.IsInEditMode && (activeEditor == null || !activeEditor.IsInBeginEditMode))
            {
                GridViewRowInfo        gridViewRowInfo    = ((GridRowElement)this.Children[position]).RowInfo;
                GridViewDetailsRowInfo viewDetailsRowInfo = gridViewRowInfo as GridViewDetailsRowInfo;
                if (viewDetailsRowInfo != null)
                {
                    gridViewRowInfo = (GridViewRowInfo)viewDetailsRowInfo.Owner;
                }
                if (gridViewRowInfo == gridViewElement.CurrentRow || gridViewElement.CurrentRow != null && gridViewElement.CurrentRow.ViewInfo != null && (gridViewElement.CurrentRow.ViewInfo.ParentRow != null && !gridViewElement.CurrentRow.ViewInfo.ParentRow.IsPinned) && gridViewElement.CurrentRow.ViewInfo.ParentRow.ViewInfo == gridViewRowInfo.ViewInfo)
                {
                    gridViewElement.CloseEditor();
                }
            }
            base.RemoveElement(position);
        }
Example #9
0
        private void UpdateChildRowHeight(int newHeight, SizeF availableSize)
        {
            GridViewDetailsRowInfo data = (GridViewDetailsRowInfo)this.Data;

            if (data.ActualHeight == newHeight)
            {
                return;
            }
            int num1 = data.ActualHeight == -1 ? 0 : data.ActualHeight;
            int num2 = newHeight - num1;

            if (num1 != 0 && !data.resetActualHeight)
            {
                GridTraverser gridTraverser = new GridTraverser((GridTraverser)this.TableElement.RowScroller.Traverser);
                gridTraverser.ProcessHierarchy = false;
                do
                {
                    ;
                }while (gridTraverser.Current != data && gridTraverser.MoveNext());
                if (!gridTraverser.MoveNext())
                {
                    return;
                }
            }
            data.resetActualHeight = false;
            data.ActualHeight      = newHeight;
            if (!this.GridViewElement.UseScrollbarsInHierarchy && this.TableElement.ViewInfo.ParentRow != null)
            {
                return;
            }
            RowScroller rowScroller = this.TableElement.RowScroller;

            if (num1 == 0)
            {
                rowScroller.UpdateScrollRange();
            }
            else
            {
                rowScroller.UpdateScrollRange(rowScroller.Scrollbar.Maximum + num2, false);
            }
        }