private void init(EwfTableCell headerCell, Unit width, string cssClass) { ColumnSetup = new ColumnSetup { Width = width, CssClassOnAllCells = cssClass ?? "" }; HeaderCell = headerCell; }
private static TableCell buildCell(EwfTableCell ewfCell, RowSetup rowSetup, ColumnSetup columnSetup, bool tableIsColumnPrimary) { var colSpan = tableIsColumnPrimary ? ewfCell.Setup.ItemSpan : ewfCell.Setup.FieldSpan; var rowSpan = tableIsColumnPrimary ? ewfCell.Setup.FieldSpan : ewfCell.Setup.ItemSpan; var underlyingCell = (rowSetup.IsHeader || columnSetup.IsHeader) ? new TableHeaderCell() : new TableCell(); underlyingCell.AddControlsReturnThis(ewfCell.Controls); if (colSpan == 1) { underlyingCell.Width = columnSetup.Width; } underlyingCell.CssClass = StringTools.ConcatenateWithDelimiter( " ", EwfTable.CssElementCreator.AllCellAlignmentsClass, columnSetup.CssClassOnAllCells, StringTools.ConcatenateWithDelimiter(" ", ewfCell.Setup.Classes.ToArray())); if (ewfCell.Setup.ClickScript != null) { ewfCell.Setup.ClickScript.SetUpClickableControl(underlyingCell); } if (!ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() || ewfCell.Setup.ToolTipControl != null || !columnSetup.ToolTipOnCells.IsNullOrWhiteSpace()) { var toolTipControl = ewfCell.Setup.ToolTipControl ?? ToolTip.GetToolTipTextControl(!ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() ? ewfCell.Setup.ToolTip : columnSetup.ToolTipOnCells); // NOTE: This comment is no longer accurate. // It is very important that we add the tool tip to the cell so that the tool tip is hidden if the row/cell is hidden. new ToolTip(toolTipControl, underlyingCell); } if (colSpan != 1) { underlyingCell.ColumnSpan = colSpan; } if (rowSpan != 1) { underlyingCell.RowSpan = rowSpan; } return(underlyingCell); }
private void init( EwfTableCell headerCell, Unit width, string cssClass ) { ColumnSetup = new ColumnSetup { Width = width, CssClassOnAllCells = cssClass ?? "" }; HeaderCell = headerCell; }
private static TableCell buildCell( EwfTableCell ewfCell, RowSetup rowSetup, ColumnSetup columnSetup, bool tableIsColumnPrimary ) { var colSpan = tableIsColumnPrimary ? ewfCell.Setup.ItemSpan : ewfCell.Setup.FieldSpan; var rowSpan = tableIsColumnPrimary ? ewfCell.Setup.FieldSpan : ewfCell.Setup.ItemSpan; var underlyingCell = ( rowSetup.IsHeader || columnSetup.IsHeader ) ? new TableHeaderCell() : new TableCell(); underlyingCell.AddControlsReturnThis( ewfCell.Controls ); if( colSpan == 1 ) underlyingCell.Width = columnSetup.Width; underlyingCell.CssClass = StringTools.ConcatenateWithDelimiter( " ", EwfTable.CssElementCreator.AllCellAlignmentsClass, columnSetup.CssClassOnAllCells, StringTools.ConcatenateWithDelimiter( " ", ewfCell.Setup.Classes.ToArray() ) ); if( ewfCell.Setup.ClickScript != null ) ewfCell.Setup.ClickScript.SetUpClickableControl( underlyingCell ); if( !ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() || ewfCell.Setup.ToolTipControl != null || !columnSetup.ToolTipOnCells.IsNullOrWhiteSpace() ) { var toolTipControl = ewfCell.Setup.ToolTipControl ?? ToolTip.GetToolTipTextControl( !ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() ? ewfCell.Setup.ToolTip : columnSetup.ToolTipOnCells ); // NOTE: This comment is no longer accurate. // It is very important that we add the tool tip to the cell so that the tool tip is hidden if the row/cell is hidden. new ToolTip( toolTipControl, underlyingCell ); } if( colSpan != 1 ) underlyingCell.ColumnSpan = colSpan; if( rowSpan != 1 ) underlyingCell.RowSpan = rowSpan; return underlyingCell; }