TableField

TableField class

Represents a field of a table in a project.

public class TableField

Constructors

Name Description
TableField() Initializes a new instance of the TableField class.

Properties

Name Description
AlignData { get; set; } Gets or sets the alignment of data in a table field.
AlignTitle { get; set; } Gets or sets the alignment of the title in a table field.
Field { get; set; } Gets or sets the type of a table field.
Title { get; set; } Gets or sets the title of the field in a table.
Width { get; set; } Gets or sets the width in points of the field column in a table.
WrapHeader { get; set; } Gets or sets a value indicating whether the table column heading can wrap to multiple lines, or if it should be truncated when it exceeds the column width.
WrapText { get; set; } Gets or sets a value indicating whether the column text can wrap to multiple lines, or if it should be truncated when it exceeds the column width. Supported by MSP 2010 version and later.

Examples

Shows how to read project tables.

var project = new Project(DataDir + "ReadTableData.mpp");

// get the table
var table = project.Tables.ToList()[0];
Console.WriteLine("Print table fields of {0}", table.Name);
Console.WriteLine("Table Fields Count" + table.TableFields.Count);

// display all table fields' information
foreach (var field in table.TableFields)
{
    Console.WriteLine("  Field: " + field.Field);
    Console.WriteLine("  Width: " + field.Width);
    Console.WriteLine("  Title: " + field.Title);
    Console.WriteLine("  Title Alignment: " + field.AlignTitle);
    Console.WriteLine("  Data Alignment: " + field.AlignData);
    Console.WriteLine("  Wrap Header: " + field.WrapHeader);
    Console.WriteLine("  Wrap Text: " + field.WrapText);
    Console.WriteLine();
}

See Also