Share via


ListColumnCollection.Add Method (String, Generic Converter)

Adds a ListColumn object to the ListColumnCollection with the specified display name and the display value that is returned from the specified delegate method. The delegate method converts information from a business object to a string that is used as the display value for the object in the column.

Namespace: Microsoft.EssentialBusinessServer.Console.ObjectModel
Assembly: Microsoft.EssentialBusinessServer.Console.ObjectModel (in microsoft.essentialbusinessserver.console.objectmodel.dll)

Usage

Syntax

'Declaration
Public Function Add ( _
    displayName As String, _
    displayValueProvider As Converter(Of TBusinessObject, String) _
) As ListColumn(Of TBusinessObject)
public ListColumn<TBusinessObject> Add (
    string displayName,
    Converter<TBusinessObject,string> displayValueProvider
)
public:
ListColumn<TBusinessObject>^ Add (
    String^ displayName, 
    Converter<TBusinessObject, String^>^ displayValueProvider
)
public ListColumn<TBusinessObject> Add (
    String displayName, 
    Converter<TBusinessObject,String> displayValueProvider
)
public function Add (
    displayName : String, 
    displayValueProvider : Converter<TBusinessObject,String>
) : ListColumn<TBusinessObject>

Parameters

  • displayName
    The display name of the column.
  • displayValueProvider
    A delegate method used to convert a business object to a string that is displayed for the object in the column.

Return Value

An instance of ListColumn that was added to the ListColumnCollection.

Example

The following code example shows a how to initialize a ListColumnCollection that includes a delegate method, which converts a business object to a string that is displayed for the objects in the column:

ListColumnCollection<BusinessObject> columns = null;
columns = new ListColumnCollection<BusinessObject>();

ListColumn<BusinessObject> column = null;
column = columns.Add("Computer Name", GetListColumnString);

private static string GetListColumnString(BusinessObject businessObj)
{
    return businessObj.ComputerName + " some additional text";
}

Exceptions

Exception type Condition
ArgumentException

One or more of the parameters are not valid.

ArgumentNullException

One or more of the parameters are null.

Remarks

TBusinessObject represents a business object that encapsulates information and methods that relate to business data or business functionality. The information in the business object is exposed as properties.

The delegate method represented by displayValueProvider can be used to add additional data or related data to the information that is provided by the business object.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008 64-bit Edition, Windows Vista 64-bit Edition, Windows Essential Business Server 2008 Standard, Windows Essential Business Server 2008 Premium

Target Platforms

Windows Essential Business Server 2008 Standard, Windows Essential Business Server 2008 Premium

See Also

Reference

ListColumnCollection Generic Class
ListColumnCollection Members
Microsoft.EssentialBusinessServer.Console.ObjectModel Namespace