示例#1
0
        // Creates a new ExcelSheetRow with the same schema as the ExcelSheet.
        public ExcelSheetRow NewRow()
        {
            ExcelSheetRow row = new ExcelSheetRow();

            row.Sheet = this;
            foreach (ExcelSheetColumn column in Columns)
            {
                ExcelSheetCell cell = new ExcelSheetCell(column);
                row.Cells.Add(cell);
            }

            return(row);
        }
示例#2
0
        public void SetHeaderByRow(int rowIndex)
        {
            if (rowIndex < Rows.Count)
            {
                DataStartRowIndex = rowIndex + 1;

                ExcelSheetRow headerRow = Rows[rowIndex];
                int           colIndex  = 0;
                foreach (ExcelSheetColumn column in this.Columns)
                {
                    string value = headerRow[colIndex].Value;
                    if (string.IsNullOrEmpty(value))
                    {
                        column.Name = string.Format("F{0}", colIndex + 1);
                    }
                    else
                    {
                        column.Name = headerRow[colIndex].Value;
                    }

                    colIndex++;
                }
            }
        }
 public ExcelSheetRowValidatingEventArgs(ExcelSheetRow row)
 {
     Row = row;
 }