public TreeViewSpreadExportCellFormattingEventArgs(
     TreeViewSpreadExportCell exportCell,
     RadTreeNode treeNode,
     int rowIndex)
 {
     this.exportCell = exportCell;
     this.treeNode   = treeNode;
     this.rowIndex   = rowIndex;
 }
Exemplo n.º 2
0
        private void AddRow(TreeViewSpreadExportRow row, int currentRowIndex)
        {
            int index1 = 0;

            for (int index2 = 0; index2 < row.Cells.Count; ++index2)
            {
                TreeViewSpreadExportCell cell1 = row.Cells[index2];
                if (this.columnWidths.Count <= index1)
                {
                    this.columnWidths.Add(0);
                }
                if (cell1 is TreeViewSpreadExportIndentCell)
                {
                    if (cell1.Size.Width > this.columnWidths[index1])
                    {
                        this.columnWidths[index1] = cell1.Size.Width;
                        this.spreadExportRenderer.SetWorksheetColumnWidth(index1, (double)cell1.Size.Width, false);
                    }
                    this.CreateCell(cell1, currentRowIndex, index1);
                }
                else if (cell1 is TreeViewSpreadExportImageCell)
                {
                    TreeViewSpreadExportImageCell cell2 = cell1 as TreeViewSpreadExportImageCell;
                    if (cell2.Image != null)
                    {
                        this.spreadExportRenderer.SetWorksheetRowHeight(currentRowIndex, cell2.Image.Size.Height, true);
                        if (cell2.Image.Size.Width > this.columnWidths[index1])
                        {
                            this.columnWidths[index1] = cell2.Image.Size.Width;
                            this.spreadExportRenderer.SetWorksheetColumnWidth(index1, (double)cell2.Image.Size.Width, false);
                        }
                        this.CreateImageOverCell(cell2, currentRowIndex, index1);
                    }
                    this.CreateCell((TreeViewSpreadExportCell)cell2, currentRowIndex, index1);
                }
                else
                {
                    this.spreadExportRenderer.SetWorksheetRowHeight(currentRowIndex, cell1.Size.Height, true);
                    int num = this.ExportImages ? this.depthOfTree + 1 : this.depthOfTree;
                    if (cell1.Size.Width > this.columnWidths[index1] && num <= index1)
                    {
                        this.columnWidths[index1] = cell1.Size.Width;
                        this.spreadExportRenderer.SetWorksheetColumnWidth(index1, (double)cell1.Size.Width, false);
                    }
                    this.CreateCell(cell1, currentRowIndex, index1);
                }
                ++index1;
            }
        }
Exemplo n.º 3
0
        protected virtual void CreateCell(
            TreeViewSpreadExportCell cell,
            int currentRowIndex,
            int currentColumnIndex)
        {
            this.spreadExportRenderer.CreateCellSelection(currentRowIndex, currentColumnIndex, currentRowIndex, currentColumnIndex + cell.ColSpan - 1);
            if (cell.ColSpan > 1)
            {
                this.spreadExportRenderer.MergeCellSelection();
            }
            TreeViewSpreadExportContentCell exportContentCell = cell as TreeViewSpreadExportContentCell;

            if (exportContentCell != null)
            {
                if (!string.IsNullOrEmpty(exportContentCell.FormatString))
                {
                    this.spreadExportRenderer.SetCellSelectionFormat(exportContentCell.FormatString);
                }
                if (exportContentCell.Value != null)
                {
                    this.spreadExportRenderer.SetCellSelectionValue(new DataTypeConvertor().ConvertToDataType(exportContentCell.Value), exportContentCell.Value);
                }
                else if (!string.IsNullOrEmpty(exportContentCell.Text))
                {
                    this.spreadExportRenderer.SetCellSelectionValue(exportContentCell.Text);
                }
                object cellSelectionValue = this.spreadExportRenderer.GetCellSelectionValue();
                if (cellSelectionValue is DateTime && !this.CheckDateTimeValue((DateTime)cellSelectionValue))
                {
                    throw new FormatException("The DateTime value is not supported in Excel!");
                }
            }
            if (!this.ExportVisualSettings && this.CellFormatting == null)
            {
                return;
            }
            if (cell.Font == null)
            {
                cell.Font = Control.DefaultFont;
            }
            this.spreadExportRenderer.CreateCellStyleInfo(cell.BackColor, cell.ForeColor, cell.Font.FontFamily, (double)cell.Font.Size, cell.Font.Bold, cell.Font.Italic, cell.Font.Underline, cell.TextAlignment, cell.TextWrap, cell.BorderBoxStyle, cell.BorderColor, cell.BorderTopColor, cell.BorderBottomColor, cell.BorderRightColor, cell.BorderLeftColor);
        }
Exemplo n.º 4
0
 protected virtual void GetStylesFromVisualCell(
     TreeViewSpreadExportCell cell,
     LightVisualElement visualCell)
 {
     if (visualCell == null)
     {
         return;
     }
     cell.Font              = visualCell.Font;
     cell.TextAlignment     = visualCell.TextAlignment;
     cell.TextWrap          = visualCell.TextWrap;
     cell.BackColor         = this.GetBackColor(visualCell);
     cell.ForeColor         = visualCell.ForeColor;
     cell.BorderBoxStyle    = visualCell.BorderBoxStyle;
     cell.BorderColor       = visualCell.BorderColor;
     cell.BorderLeftColor   = visualCell.BorderLeftColor;
     cell.BorderTopColor    = visualCell.BorderTopColor;
     cell.BorderRightColor  = visualCell.BorderRightColor;
     cell.BorderBottomColor = visualCell.BorderBottomColor;
 }