Ejemplo n.º 1
0
 void ExportHeaders(Excel.Worksheet worksheet)
 {
     for (int column = 0, worksheetColumn = 1; column < m_grid.ColumnCount; column++)
     {
         if (IsExportableColumn(column))
         {
             Excel.Cell currentHeader = worksheet[1, worksheetColumn++];
             currentHeader.Value     = m_grid.Columns[column].HeaderText;
             currentHeader.Font.Bold = true;
             currentHeader.AutoFitEntireColumn();
         }
     }
 }
Ejemplo n.º 2
0
        private void ExportHeaders(Excel.Worksheet worksheet)
        {
            int i   = 0;
            int num = 1;

            while (i < this.m_grid.ColumnCount)
            {
                if (this.IsExportableColumn(i))
                {
                    Excel.Cell cell = worksheet[1, num++];
                    cell.Value     = this.m_grid.Columns[i].HeaderText;
                    cell.Font.Bold = true;
                    cell.AutoFitEntireColumn();
                }
                i++;
            }
        }