ListColumnCollection<TBusinessObject>.Add Method (String, String, IFormatProvider, 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. A format string and a format provider that are used to format the display value are also specified.
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,
IFormatProvider formatProvider,
string format
)
public:
ListColumn<TBusinessObject>^ Add(
String^ displayName,
String^ propertyName,
IFormatProvider^ formatProvider,
String^ format
)
Public Function Add (
displayName As String,
propertyName As String,
formatProvider As IFormatProvider,
format 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.
formatProvider
Type: System.IFormatProviderThe IFormatProvider that is used to format the value of the column.
format
Type: System.StringThe format string that is used to format the value that is displayed in the column.
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.
If the type that propertyName represents implements IFormattable, the formatProvider and format are used to call ToString on the instance of the property.
For more information about using format providers and customizing the format of strings, see “Customizing Format Strings” at the Microsoft Web site (https://go.microsoft.com/fwlink/?LinkId=116099).
See Also
Add Overload
ListColumnCollection<TBusinessObject> Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top