Tables are diagram nodes that can contain multiple cells and can be related to other nodes through their rows.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming
C# Copy Code |
---|
public class TableNode : DiagramNode, Scrollable |
Visual Basic Copy Code |
---|
Public Class TableNode |
Tables in flow diagrams are represented by instances of the TableNode class. Probably the most important property of tables is ConnectionStyle, which specifies whether users are allowed to draw links to the rows of a table, to the table as an integral entity, or both.
Tables consist of Cell instances distributed across rows and columns. Number of rows and columns can be set with the RowCount and ColumnCount properties. The width of the columns is set with ColumnWidth property and the height of the rows with the RowHeight property. Cells can be made to span several rows and columns by setting their RowSpan and ColumnSpan properties to values larger than one.
Rows can be assigned to distinct sections of the table. Each section can be collapsed or expanded, hiding or showing all rows in the section except the header one. To define a section, set a Header row. A section consists of all rows after a header row and spans to the next header. Each header row displays a [±] button that allows expanding or collapsing the section interactively. The button appears either on the left of the first cell of a header row or in a separate column, as set in OffsetHeaderRows. Clicking that button raises the TableSectionCollapsed and TableSectionExpanded events. Sections can be collapsed or expanded programmatically using the Expanded property of their header rows.
The structure of a table can be dynamically changed by adding and deleting rows and columns. This can be done with the AddColumn and AddRow methods as well as with the InsertColumn, InsertRow and RedimTable methods. DeleteRow and DeleteColumn methods delete existing rows and columns.
Table cells contain Text, displayed as specified through TextBrush and TextFormat. A table can also have a caption, whose text is set by the Caption property. The height of the caption and the alignment of the text are specified by CaptionHeight and CaptionFormat properties. To get even richer text formatting, set EnableStyledText to true and embed HTML-like formatting tags in the caption and cell texts. The ResizeToFitText method resizes all columns and rows so that each table cell fits its text on a single line without clipping it.
To display a text box that lets users edit the table caption or the text of a cell, call the BeginEdit method of DiagramView. Call EndEdit to exit the in-place editing mode. If the view's AllowInplaceEdit property is enabled, users can double-click the table caption bar or a cell in order to edit their text.
The interior of tables is filled using their Brush property. The color of the table and cell borders can be set by using the Pen property. The table caption bar is painted using the CaptionBackBrush brush.
In order to set an image as table's background use the Image property. The alignment of the image in relation to the table's rectangle is set through the ImageAlign property. The table can be resized to fit the size of its image by calling the ResizeToFitImage method.
The rectangle, which a table occupies, is accessible with the Bounds property. Rows and columns that build the table are stored and accessed by means of the Rows and Columns collections.
System.Object
MindFusion.Diagramming.DiagramItem
MindFusion.Diagramming.DiagramNode
MindFusion.Diagramming.TableNode