C# Class Rock.Web.UI.Controls.AttributeField

If DataItem implements IHasAttributes, this gets the Attribute value for the dataitem using DataField as the Attribute.Key. Otherwise, it will look in the grid.ObjectList[key] using the DataField as the lookup key. Example: If using a Person Grid, the value of the Attribute "FavoriteColor" would be shown in the grid by specifying this grid column <Rock:AttributeField DataField="FavoriteColor" HeaderText="Person's Favorite Color" />
Inheritance: RockBoundField
显示文件 Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
GetExportValue ( System.Web.UI.WebControls.GridViewRow row ) : object

Gets the value that should be exported to Excel

Protected Methods

Method Description
FormatDataValue ( object dataValue, bool encode ) : string

Formats the specified field value for a cell in the T:System.Web.UI.WebControls.BoundField object.

GetValue ( System controlContainer ) : object

Retrieves the value of the field bound to the T:System.Web.UI.WebControls.BoundField object.

Private Methods

Method Description
GetAttributeObject ( System.Web.UI.WebControls.GridViewRow row ) : IHasAttributes

Gets the attribute object.

GetRowValue ( System.Web.UI.WebControls.GridViewRow row, bool condensed, bool formatAsHtml ) : object

Gets the row value.

Method Details

FormatDataValue() protected method

Formats the specified field value for a cell in the T:System.Web.UI.WebControls.BoundField object.
protected FormatDataValue ( object dataValue, bool encode ) : string
dataValue object The field value to format.
encode bool true to encode the value; otherwise, false.
return string

GetExportValue() public method

Gets the value that should be exported to Excel
public GetExportValue ( System.Web.UI.WebControls.GridViewRow row ) : object
row System.Web.UI.WebControls.GridViewRow The row.
return object

GetValue() protected method

Retrieves the value of the field bound to the T:System.Web.UI.WebControls.BoundField object.
protected GetValue ( System controlContainer ) : object
controlContainer System The container for the field value.
return object