コード例 #1
0
 public UIDataGridView(RectangleF rect)
 {
     _rect               = rect;
     header              = new UIView();
     content             = new UIView();
     rHeader             = new UIView();
     AutoGenerateColumns = true;
     _scrollView         = new ScrollViewWithHeader(rect, header, content, true);
 }
コード例 #2
0
        public void UpdateGrid()
        {
            if (_items == null || _items.Length == 0)
            {
                return;
            }
            generateColumns();
            _rows = new List <UIDataGridRow>();
            int curIndex = 0;

            foreach (var item in _items)
            {
                _rows.Add(generateRow(item, curIndex));
                curIndex++;
            }
            var maxX = Rows.Max(x => x.MaxX);
            var maxY = Rows.Max(y => y.MaxY);

            header  = new UIView(new RectangleF(0, 0, maxX, RowHeight));
            rHeader = new UIView(new RectangleF(0, 0, RowHeaderWidth, maxY));

            foreach (var col in headerRow.Cells)
            {
                header.AddSubview(col);
            }
            content = new UIView(new RectangleF(0, 0, maxX, maxY));
            foreach (var row in _rows)
            {
                rHeader.AddSubview(new UILabel(new RectangleF(0, RowHeight * row.RowIndex, RowHeaderWidth, RowHeight))
                {
                    Text = (row.RowIndex + 1).ToString()
                });
                foreach (var cell in row.Cells)
                {
                    content.AddSubview(cell);
                }
            }

            _scrollView = new ScrollViewWithHeader(_rect, header, rHeader, content, true);
        }
コード例 #3
0
ファイル: UIDataGridView.cs プロジェクト: Clancey/ClanceyLib
        public void UpdateGrid()
        {
            if(_items == null || _items.Length == 0)
                return;
            generateColumns();
            _rows = new List<UIDataGridRow>();
            int curIndex = 0;
            foreach(var item in _items)
            {
                _rows.Add(generateRow(item,curIndex));
                curIndex ++;
            }
            var maxX = Rows.Max(x=> x.MaxX);
            var maxY = Rows.Max(y=> y.MaxY);

            header = new UIView(new RectangleF(0,0,maxX,RowHeight));
            rHeader = new UIView(new RectangleF(0,0,RowHeaderWidth,maxY));

            foreach( var col in headerRow.Cells)
            {
                header.AddSubview(col);
            }
            content = new UIView(new RectangleF(0,0,maxX, maxY));
            foreach(var row in _rows)
            {
                rHeader.AddSubview(new UILabel(new RectangleF(0,RowHeight * row.RowIndex,RowHeaderWidth,RowHeight)){Text = (row.RowIndex + 1).ToString()});
                foreach(var cell in row.Cells)
                {
                    content.AddSubview(cell);
                }
            }

            _scrollView = new ScrollViewWithHeader(_rect,header,rHeader,content,true);
        }
コード例 #4
0
ファイル: UIDataGridView.cs プロジェクト: Clancey/ClanceyLib
 public UIDataGridView(RectangleF rect)
 {
     _rect = rect;
     header = new UIView();
     content = new UIView();
     rHeader = new UIView();
     AutoGenerateColumns = true;
     _scrollView = new ScrollViewWithHeader(rect,header,content,true);
 }