Ejemplo n.º 1
0
        /// <summary>
        /// 获取所有的子表格列
        /// </summary>
        /// <returns>列头集合</returns>
        public ArrayList <FCBandedFCGridColumn> getAllChildColumns()
        {
            ArrayList <FCBandedFCGridColumn> columns = new ArrayList <FCBandedFCGridColumn>();
            int columnsSize = m_columns.size();

            for (int i = 0; i < columnsSize; i++)
            {
                FCBandedFCGridColumn column = m_columns.get(i);
                columns.add(column);
            }
            int bandsSize = m_bands.size();

            for (int i = 0; i < bandsSize; i++)
            {
                FCGridBand band = m_bands.get(i);
                ArrayList <FCBandedFCGridColumn> childColumns = band.getAllChildColumns();
                int childColumnsSize = childColumns.size();
                for (int j = 0; j < childColumnsSize; j++)
                {
                    FCBandedFCGridColumn childColumn = childColumns[j];
                    columns.add(childColumn);
                }
            }
            return(columns);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 重置列头布局
        /// </summary>
        public override void resetHeaderLayout()
        {
            int          left = 0, top = 0, scrollH = 0;
            FCHScrollBar hScrollBar = HScrollBar;

            if (hScrollBar != null && hScrollBar.Visible)
            {
                scrollH = -hScrollBar.Pos;
            }
            int headerHeight     = HeaderVisible ? HeaderHeight : 0;
            int horizontalOffset = HorizontalOffset;
            int verticalOffset   = VerticalOffset;
            int bandsSize        = m_bands.size();

            for (int i = 0; i < bandsSize; i++)
            {
                FCGridBand band = m_bands.get(i);
                if (band.Visible)
                {
                    int    bandHeight = headerHeight < band.Height ? headerHeight : band.Height;
                    FCRect bandRect   = new FCRect(left + horizontalOffset, top + verticalOffset,
                                                   left + horizontalOffset + band.Width, top + bandHeight + verticalOffset);
                    bool hasFrozenColumn = false;
                    ArrayList <FCBandedFCGridColumn> childColumns = band.getAllChildColumns();
                    int childColumnsSize = childColumns.size();
                    for (int j = 0; j < childColumnsSize; j++)
                    {
                        if (childColumns.get(j).Frozen)
                        {
                            hasFrozenColumn = true;
                            break;
                        }
                    }
                    if (!hasFrozenColumn)
                    {
                        bandRect.left  += scrollH;
                        bandRect.right += scrollH;
                    }
                    band.Bounds = bandRect;
                    band.resetHeaderLayout();
                    left += band.Width;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 重新布局
 /// </summary>
 public override void update()
 {
     if (!m_lockUpdate)
     {
         int bandsSize = m_bands.size();
         //清除所有的列
         int col = 0;
         for (int i = 0; i < bandsSize; i++)
         {
             FCGridBand band = m_bands.get(i);
             ArrayList <FCBandedFCGridColumn> childColumns = band.getAllChildColumns();
             int childColumnsSize = childColumns.size();
             for (int j = 0; j < childColumnsSize; j++)
             {
                 FCBandedFCGridColumn column = childColumns.get(j);
                 column.Index = col;
                 col++;
             }
         }
     }
     base.update();
 }