ListColumnCollection<TBusinessObject>.Add Method (String, String)
Adds a ListColumn<TBusinessObject> object to the ListColumnCollection<TBusinessObject> with the specified display name and the specified property name. The property name is retrieved from the business object and is used as the display value for the object in the column.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
public ListColumn<TBusinessObject> Add(
string displayName,
string propertyName
)
public:
ListColumn<TBusinessObject>^ Add(
String^ displayName,
String^ propertyName
)
Public Function Add (
displayName As String,
propertyName As String
) As ListColumn(Of TBusinessObject)
Parameters
displayName
Type: System.StringThe display name of the column.
propertyName
Type: System.StringA property name of a business object from which the column value will be retrieved.
Return Value
Type: Microsoft.WindowsServerSolutions.Administration.ObjectModel.ListColumn<TBusinessObject>
An instance of ListColumn<TBusinessObject> that was added to the ListColumnCollection<TBusinessObject>.
Exceptions
Exception | 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.
Examples
The following code example shows how to initialize a ListColumnCollection<TBusinessObject> with a specified display name and property name:
ListColumnCollection<BusinessObject> columns = null;
columns = new ListColumnCollection<BusinessObject>();
ListColumn<BusinessObject> column = null;
column = columns.Add("Computer Name", "ComputerName");
See Also
Add Overload
ListColumnCollection<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top