Example #1
0
        /// <summary>
        /// 添加一个单元格
        /// </summary>
        /// <param name="columnIndex"></param>
        /// <param name="rowIndex"></param>
        /// <param name="content"></param>
        public CellData AddCell(int columnIndex, int rowIndex, string content, float rowHeigth, float columnWidth, int rowMerge, int columnMerge, bool isNull)
        {
            var cell = TableController.CellController.Create <TableCell>();
            var data = CellDatas.FirstOrDefault(p => p.ColumnIndex == columnIndex && p.RowIndex == rowIndex);

            if (data != null)
            {
                data.Content = content;
                return(data);
            }

            data = new CellData(TableController, cell, columnIndex, rowIndex, content, rowHeigth, columnWidth, rowMerge, columnMerge, isNull);
            if (columnIndex < ColumnDatas.Count)
            {
                var column = ColumnDatas[columnIndex];
                data.ColumnWidth = column.Width;
            }
            if (rowIndex < RowDatas.Count)
            {
                var row = RowDatas[rowIndex];
                data.RowHeigth = row.Heigth;
            }
            CellDatas.Add(data);
            return(data);
        }
Example #2
0
 private void InitTitleInfo()
 {
     foreach (Nglobal.DictionaryName name in Enum.GetValues(typeof(Nglobal.DictionaryName)))
     {
         CellData cellData = new CellData();
         cellData.type  = "title";
         cellData.altas = name.ToString();
         CellDatas.Add(cellData);
     }
 }