Rendering Container Objects

Rendering Container Objects

Important  The Collaboration Data Objects (CDO) 1.2.1 Rendering objects are not installed by or supported for use with Exchange Server 2003 or later.

A container object can be a CDO AddressEntries, Folders, Messages, or Recipients collection. To render any container object and its contents, you use a ContainerRenderer object.

When you render a container object you apply a view to it. After you have specified the container object in the container renderer's DataSource property, a Views collection is available through the container renderer's Views property. From this collection you select the appropriate CalendarView or TableView object and set the CurrentView property to that object. If you do not make a selection, the current view remains set to the default view, which is the first view in the collection unless specified otherwise by the underlying store.

A calendar view or table view is normally defined externally to your rendering application. For a folder there are three types of predefined table views: common views, folder views, and personal views. Common views are defined globally for all folders and all messaging users. A set of folder views can be defined for each individual folder, and a set of personal views for each individual messaging user. An address book container has no common, folder, or personal views predefined. The type of a calendar view is available in its Source property, and that of a table view in its Source property.

Modifications you make to predefined views do not persist in storage, but they remain in effect for your application until you change the source of the view. Modifications to folder views last until the DataSource property is changed, and modifications to common and personal views last until the ContainerRenderer object is released. Simply changing the CurrentView property does not nullify your modifications.

In addition to the predefined views for the container object you are rendering, you can create new custom views with the collection's Add method. This is the only type of view you can use when rendering an address book container. A custom view is nonpersistent and cannot be saved. However, it is still available when the DataSource property is changed. You cannot delete any views from the Views collection.

A CalendarView or TableView object specifies the overall rendering of a container object through its Columns property, which returns a child Columns collection for the table view. The order of the columns in the collection determines their display order. You can use the collection's Add method to add new columns, which cease to exist when the collection is released, for example when the DataSource property is changed. Columns cannot be deleted from their collection.

Each Column object corresponds to one property of the items in the container object being rendered. The Column object specifies the renderable property in its Property property and a rendering source for that property in the RenderUsing property. As with a pattern, the rendering source is a string containing HTML hypertext and substitution tokens. The Column object also specifies the relative width of the column in its Width property and control flags for the rendering in its Flags property.

The modifications you can make to a column consist of changing its Flags, RenderUsing, and Width properties. The modifications you can make to an existing calendar view or table view consist of adding and changing columns in its child Columns collection. Column modifications remain in effect until the Columns collection is released, which is usually when the DataSource property is changed. Calendar view and table view modifications remain in effect until the source of the view is changed, namely the DataSource property for custom and folder views, or the ContainerRenderer object for common and personal views.