Represents a column

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

Syntax

C#
public sealed class Column : ICloneable
Visual Basic
Public NotInheritable Class Column
	Implements ICloneable
Visual C++
public ref class Column sealed : ICloneable
F#
[<SealedAttribute>]
type Column =  
    class
        interface ICloneable
    end

Remarks

Usually, the identifier of the Column indicates which property of the data object will be called to get or set a value. An access to properties of the user-defined data objects is conducted through the IDataAccessor interface, which wraps the user-defined object.

When a Column is added to a Header, it can be found not only by identifier, but also by Column.Index. The index does not specify the visible position of the Column. It indicates the order in which it has been inserted. This Column.Index is not changed when the user moves, hides or shows Columns. Only the Column.VisibleIndex is changed. This feature permits to access and index the IDataField of IDataAccessors that do not support identifiers. For example IList objects are inserted into the rows of the Grid.

Following example demonstrates how to configure header and columns:

 Copy imageCopy
void ConfigureGridHeaders(Grid grid)
{
    //Add a new header on the top hierarchical level (level 0)
    grid.Headers.Add(new Header());

    //Add a header on the 1st hierarchical level (level 1) and make it invisible
    grid.Headers.Add(new Header());
    grid.Headers[1].Visible = false;

    //Create a column and add it to the top-level header
    Column column = new Column("time");
    grid.Headers[0].Add(column);
    grid.Headers[0].Add(new Column("price"));

    //Set the label for column, identified by the 'time' identifier on the top hierarchical level
    grid.Headers[0]["time"].Name = "Time column";    

    //Move the column
    column.VisibleIndex = 1;
}

Inheritance Hierarchy

System..::..Object
  Dapfor.Net.Ui..::..Column

Thread Safety

The class is not thread safe.

See Also