Gets the count of all Columns (visible and invisible).

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public int Count { get; }
Visual Basic
Public ReadOnly Property Count As Integer
	Get
Visual C++
public:
property int Count {
	int get ();
}
F#
member Count : int with get

Property Value

Type: Int32
The count of Columns.

Examples

 Copy imageCopy
public void VisibleColumnsExample(Grid grid)
{
    //Add a new header on the top hierarchical level (level 0)
    Header header = new Header();
    header.Add(new Column("Column1"));
    header.Add(new Column("Column2"));
    header.Add(new Column("Column3"));
    grid.Headers.Add(header);

    Console.WriteLine("Visible columns count: {0}", header.VisibleColumns.Count);

    header[1].Visible = false;
    Console.WriteLine("Columns count: {0}", header.Count);
    Console.WriteLine("Visible columns count: {0}", header.VisibleColumns.Count);

    //Move the last visible column to the beginning
    header.VisibleColumns[1].VisibleIndex = 0;

    //Iterate all visible columns
    foreach (Column column in header.VisibleColumns)
    {
        Console.WriteLine("Visible column: id = '{0}', index = {1}, visible index = {2}", column.Id, column.Index, column.VisibleIndex);
    }

    //Make all columns invisible 
    header.VisibleColumns.Clear();
    Console.WriteLine("Columns count: {0}", header.Count);
    Console.WriteLine("Visible columns count: {0}", header.VisibleColumns.Count);
}

//Console output:
Visible columns count: 3
Columns count: 3
Visible columns count: 2
Visible column: id = 'Column3', index = 2, visible index = 0
Visible column: id = 'Column1', index = 0, visible index = 1
Columns count: 3
Visible columns count: 0

See Also