Пример #1
0
        /// <summary>
        /// Highlights the row to show we are working on it
        /// </summary>
        /// <param name="ss"></param>
        /// <param name="rowIndex"></param>
        /// <param name="highlightColor"></param>
        public static void HighlightRow(this SfSpreadsheet ss, int rowIndex, ExcelKnownColors highlightColor)
        {
            var activeRow = ss.ActiveSheet.Rows[rowIndex];

            Application.Current.Dispatcher.Invoke(() =>

            {
                activeRow.CellStyle.ColorIndex = highlightColor;
                foreach (var cell in activeRow.Cells)
                {
                    ss.ActiveGrid.InvalidateCell(cell.Row, cell.Column);
                }
            });
        }
Пример #2
0
 /// <summary>
 /// Cells the style.
 /// </summary>
 /// <param name="xlsSheet">The XLS sheet.</param>
 /// <param name="startRow">The start row.</param>
 /// <param name="startCol">The start col.</param>
 /// <param name="endRow">The end row.</param>
 /// <param name="endCol">The end col.</param>
 /// <param name="isBold">if set to <c>true</c> [is bold].</param>
 /// <param name="isItalic">if set to <c>true</c> [is italic].</param>
 /// <param name="color">The color.</param>
 private void CellStyle(IWorksheet xlsSheet, int startRow, int startCol, int endRow, int endCol, bool isBold, bool isItalic, ExcelKnownColors color)
 {
     CellStyle(xlsSheet, startRow, startCol, endRow, endCol, isBold, isItalic);
     CellStyle(xlsSheet, startRow, startCol, endRow, endCol, color);
 }
Пример #3
0
 /// <summary>
 /// Cells the style.
 /// </summary>
 /// <param name="xlsSheet">The XLS sheet.</param>
 /// <param name="startRow">The start row.</param>
 /// <param name="startCol">The start col.</param>
 /// <param name="endRow">The end row.</param>
 /// <param name="endCol">The end col.</param>
 /// <param name="color">The color.</param>
 private void CellStyle(IWorksheet xlsSheet, int startRow, int startCol, int endRow, int endCol, ExcelKnownColors color)
 {
     xlsSheet.Range[startRow, startCol, endRow, endCol].CellStyle.Font.Color = color;
 }