System.Web.UI.WebControls
[ class tree: System.Web.UI.WebControls ] [ index: System.Web.UI.WebControls ] [ all elements ]

Class: TDataGridColumn

Source Location: /Web/UI/WebControls/TDataGridColumn.php

Class Overview

TComponent
   |
   --TControl
      |
      --TDataGridColumn

TDataGridColumn class

Class Details

[line 65]
TDataGridColumn class

TDataGridColumn serves as the base class for the different column types of the TDataGrid control. TDataGridColumn defines the properties and methods that are common to all column types. In particular, it initializes header and footer cells according to HeaderText, HeaderStyle, FooterText, and FooterStyle. If HeaderImageUrl is specified, the image will be displayed instead in the header cell. The ItemStyle is applied to non-header and -footer items.

When the datagrid enables sorting, if the SortExpression is not empty, the header cell will display a button (linkbutton or imagebutton) that will bubble sort command event to the datagrid.

The framework provides the following TDataGridColumn descendant classes,

  • TBoundColumn, associated with a specific field in datasource and displays the corresponding data.
  • TEditCommandColumn, displaying edit/update/cancel command buttons
  • TButtonColumn, displaying generic command buttons that may be bound to specific field in datasource.
  • THyperLinkColumn, displaying a hyperlink that may be boudn to specific field in datasource.
  • TTemplateColumn, displaying content based on templates.
To create your own column class, simply override initializeCell() method, which is the major logic for managing the data and presentation of cells in the column.

Namespace: System.Web.UI.WebControls

Properties

  • ItemStyle, string, stored in viewstate
    Gets or sets the css style for item cell
  • HeaderText, string, stored in viewstate
    Gets or sets the text to be displayed in header cell
  • HeaderStyle, string, stored in viewstate
    Gets or sets the css style for header cell
  • HeaderImageUrl, string, stored in viewstate
    Gets or sets the url to the image that will be displayed in header cell
  • FooterText, string, stored in viewstate
    Gets or sets the text to be displayed in footer cell
  • FooterStyle, string, stored in viewstate
    Gets or sets the css style for footer cell
  • SortExpression, string, stored in viewstate
    Gets or sets the sort expression that will be passed to OnSortCommand event parameter.




abstract:  
version:  v1.0, last update on 2004/08/13 21:44:52
author:  Qiang Xue <qiang.xue@gmail.com>


[ Top ]

Methods


Child classes:

TBoundColumn
TBoundColumn class
TButtonColumn
TButtonColumn class
TEditCommandColumn
TEditCommandColumn class
THyperLinkColumn
THyperLinkColumn class
TTemplateColumn
TTemplateColumn class

Inherited Variables

Inherited Methods

Class: TControl

TControl::__construct()
Constructor.
TControl::addBody()
Appends an object into the body collection of this control.
TControl::addParsedObject()
Adds the object parsed in template as a body of the component.
TControl::allowBody()
Determines whether the control can add the object as a body.
TControl::clearViewState()
Clears viewstate
TControl::findBodyControl()
TControl::getAttribute()
TControl::getAttributes()
Returns the attribute list object.
TControl::getAttributesToRender()
Returns attributes to be rendered.
TControl::getBodies()
TControl::getClientID()
Returns the client ID of the component.
TControl::getContainer()
Returns the container of this component.
TControl::getSkinName()
TControl::getTagName()
TControl::getViewState()
Returns a viewstate value.
TControl::initSkin()
Initializes a skin for the control. If a skin name is provided then that skin will be loaded.
TControl::isViewStateEnabled()
TControl::isVisible()
This method checks whether a control is visible.
TControl::loadViewState()
Loads viewstate into this component and its children.
TControl::onBubbleEvent()
This method responds to a bubbled event.
TControl::onInit()
This method is invoked when the control enters 'Init' stage.
TControl::onInitRecursive()
Calls onInit of this control and its children recursively.
TControl::onLoad()
This method is invoked when the control enters 'Load' stage.
TControl::onLoadRecursive()
Calls onLoad of this control and its children recursively.
TControl::onPreRender()
This method is invoked when the control enters 'PreRender' stage.
TControl::onPreRenderRecursive()
Calls onPreRender of this control and its children recursively.
TControl::onUnload()
This method is invoked when the control enters 'Unload' stage.
TControl::onUnloadRecursive()
Calls onUnload of this control and its children recursively.
TControl::raiseBubbleEvent()
Invokes the parent's onBubbleEvent method.
TControl::removeBodies()
Removes all body content.
TControl::render()
Renders this control.
TControl::renderAttributes()
Renders the attributes.
TControl::renderBody()
Renders the body content.
TControl::saveViewState()
Returns the viewstate of this component and its children.
TControl::setAttribute()
Sets an attribute.
TControl::setContainer()
Sets the container of this component
TControl::setEnableViewState()
TControl::setSkinName()
Sets the skin to use for this control
TControl::setTagName()
Sets the tag name.
TControl::setViewState()
Sets a viewstate value.
TControl::setVisible()
TControl::synchronizeControl()
This method should only be used by framework developer.

Class: TComponent

TComponent::__construct()
Constructor.
TComponent::addChild()
Adds a child component.
TComponent::addParsedObject()
Handles a component or string met in template.
TComponent::attachEventHandler()
Attaches a handler function to an event.
TComponent::bindProperty()
Sets up the binding between a property and an expression.
TComponent::canGetProperty()
Determines whether a property can be read.
TComponent::canSetProperty()
Determines whether a property can be written.
TComponent::createComponent()
Creates a child component.
TComponent::dataBind()
Performs the databinding for this component.
TComponent::evaluateExpression()
Evaluates a PHP expression.
TComponent::evaluateStatements()
Evaluates a list of PHP statements.
TComponent::findObject()
Finds an object by its ID path.
TComponent::getApplication()
TComponent::getChild()
TComponent::getChildren()
TComponent::getDefinition()
Returns or builds a component definition.
TComponent::getGlobalization()
Returns the Globalization instance for the application.
TComponent::getID()
TComponent::getModule()
Returns the module object that contains the component or the page containing the component.
TComponent::getPage()
TComponent::getParent()
TComponent::getPropertyInitValue()
Gets the initial value of a property.
TComponent::getPropertyType()
Returns the type of a property
TComponent::getRequest()
Returns the request object associated with application.
TComponent::getServiceManager()
Returns the service manager for this application.
TComponent::getSession()
Returns the session object associated with the application.
TComponent::getSessionState()
Returns a session variable.
TComponent::getUniqueID()
Returns the unique ID of the component.
TComponent::getUser()
Returns the user object associated with the application.
TComponent::hasChildren()
TComponent::hasEvent()
Determines whether an event is defined.
TComponent::hasProperty()
Determines whether a property is defined.
TComponent::initProperties()
Initializes the property values.
TComponent::instantiateTemplate()
Parses a template string and instantiates the content.
TComponent::onDataBinding()
This method is invoked when dataBind is invoked for the component.
TComponent::raiseEvent()
Invokes all attached event handler functions for a particular event.
TComponent::removeChild()
Removes a child component.
TComponent::removeChildren()
Removes all child components.
TComponent::setAttribute()
Sets an attribute.
TComponent::setDefinition()
Sets a component definition.
TComponent::setID()
Sets a component ID.
TComponent::setParent()
Sets the parent of this component.
TComponent::setPropertyInitValue()
Sets the initial value of a property.
TComponent::setRoot()
Sets the root component in the component hierarchy.
TComponent::setSessionState()
Sets a session variable.
TComponent::unbindProperty()
Breaks the binding between a property and an expression.
TComponent::__get()
Returns a property value by name or a child component by ID.
TComponent::__set()
Sets value of a component property.

Class Methods


method getFooterStyle [line 142]

string getFooterStyle( )



return:  the style for the footer of this column
access:  public


[ Top ]

method getFooterText [line 94]

string getFooterText( )



return:  the text to be displayed in the footer of this column
access:  public


[ Top ]

method getHeaderImageUrl [line 126]

string getHeaderImageUrl( )



return:  the url of the image to be displayed in header
access:  public


[ Top ]

method getHeaderStyle [line 110]

string getHeaderStyle( )



return:  the style for the header of this column
access:  public


[ Top ]

method getHeaderText [line 78]

string getHeaderText( )



return:  the text to be displayed in the header of this column
access:  public


[ Top ]

method getItemStyle [line 158]

string getItemStyle( )



return:  the style for each item of this column
access:  public


[ Top ]

method getSortExpression [line 174]

string getSortExpression( )



return:  the name of the field or expression for sorting
access:  public


[ Top ]

method initializeCell [line 191]

void initializeCell( TTableCell $cell, integer $columnIndex, string $itemType)

Initializes the specified cell to its initial values.

The default implementation sets the content of header and footer cells and the style of other kinds of cell. If sorting is enabled by the grid and sort expression is specified in the column, the header cell will show a link/image button. Otherwise, the header/footer cell will only show static text/image. This method can be overriden to provide customized intialization to column cells.




access:  public


Overridden in child classes as:

TBoundColumn::initializeCell()
Initializes the specified cell to its initial values.
TButtonColumn::initializeCell()
Initializes the specified cell to its initial values.
TEditCommandColumn::initializeCell()
Initializes the specified cell to its initial values.
THyperLinkColumn::initializeCell()
Initializes the specified cell to its initial values.
TTemplateColumn::initializeCell()
Initializes the specified cell to its initial values.

Parameters:

TTableCell   $cell   the cell to be initialized.
integer   $columnIndex   the index to the Columns property that the cell resides in.
string   $itemType   the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)

[ Top ]

method propagateAttribute [line 269]

void propagateAttribute( mixed $cell)

Propagate the attributes in the columns to the cells.



access:  protected


[ Top ]

method setFooterStyle [line 134]

void setFooterStyle( string $value)



access:  public


Parameters:

string   $value   style for the footer of this column

[ Top ]

method setFooterText [line 86]

void setFooterText( string $value)



access:  public


Parameters:

string   $value   text to be displayed in the footer of this column

[ Top ]

method setHeaderImageUrl [line 118]

void setHeaderImageUrl( string $value)



access:  public


Parameters:

string   $value   the url of the image to be displayed in header

[ Top ]

method setHeaderStyle [line 102]

void setHeaderStyle( string $value)



access:  public


Parameters:

string   $value   style for the header of this column

[ Top ]

method setHeaderText [line 70]

void setHeaderText( string $value)



access:  public


Parameters:

string   $value   text to be displayed in the header of this column

[ Top ]

method setItemStyle [line 150]

void setItemStyle( string $value)



access:  public


Parameters:

string   $value   style for each item of this column

[ Top ]

method setSortExpression [line 166]

void setSortExpression( string $value)



access:  public


Parameters:

string   $value   the name of the field or expression for sorting

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.