ServerDataGrid V1.1 F2.0

File Name: Server_DataGrid.asp
Class Name: ServerDataGrid.asp

Overview
Renders the contents of a DataSource (ADODB.Recordset) as a Grid/Table.



Public Constructors
New_ServerDataGrid(name) This constructor is used to create an instance of the control while at the same time assiging it a name and id.
New ServerDataGrid This is the default constructor and it will create an instance of the control without a name. Controls instanciated this way must assign the name of the control manually by doing this: <controlVariable>.Control.Name = "<ControlName>"

Public Properties
Control WebControl Inherits attributes from the WebControl class.
Columns DataGridColumn Array of of type DataGridColumn
DataSource ADODB.RecordSet The datasource used to render the control contents.
ShowHeader Boolean Sets/Gets a value to indicate wether or not the column headers should be displayed.
HorizonalAlign String Sets/Gets the horizontal alignment forthe table.
CellPadding Int Sets/Gets the cellpading for the tabke.
CellSpacing Int Sets/Gets the cellpacing for the table.
BorderWidth Int Sets/Gets the border width for the table.
BorderColor String Sets/Gets the border color for the table.
BackImageURL String Sets/Gets the background image for the table.
TableStyle String Sets/Gets the style of the table.
TableCssClass String Sets/Gets the CLASS of the table.
TableWidth String Sets/Gets the width of the table.
AllowCustomPaging Boolean Sets/Gets a value to indicate wether or not the grid will work in custom paging mode. When on this mode the user must set the VirtualItemCount property manually.
AllowPaging Boolean Sets/Gets a value to indicate wether or not a Pager should be displayed to navigate through the records.
AutoGenerateColumns Boolean Sets/Gets a value to indicate wether or not the DataGrid will automatically generate the columns before rendering the grid.
HeaderStyle String Sets/Gets the style of the table header.
FooterStyle String Sets/Gets the style of the table footer.
ItemStyle String Sets/Gets the default style used to render a row.
AlternatingItemStyle String Sets/Gets the style to be used to render alternating rows.
EditItemStyle String Sets/Gets the style to be used to render the row that is on EditMode.
SelectedItemStyle String Sets/Gets the style to be used to render the row that is selected.
SortStyle String Sets/Gets the style to be used to render a sort column.
HeaderCssClass String Sets/Gets the class of the header.
FooterCssClass String Sets/Gets the class of the footer.
ItemCssClass String Sets/Gets the default class to be used to render a row.
AlternatingItemCssClass String Sets/Gets the class to be used to render alternating rows.
EditItemCssClass String Sets/Gets the class to be used to render the row that is on EditMode.
SelectedItemCssClass String Sets/Gets the class to be used to render the seleted row.
SortCssClass String Sets/Gets the class to be used to render a sortable column.
EditItemIndex String Sets/Gets the index of the row being edited (-1 none)
SelectedItemIndex String Sets/Gets the index of the selected row. (-1 none)
HeaderFunctionName String Sets/Gets the name of the function (if any) used to render the table header.
FooterFunctionName String Sets/Gets the name of the function (if any) used to render the table footer.
Pager Server_DataPager Gets the pager used by the DataGrid. You can control Pager specific settings using this property.
PagerHorizontalAlign String Gets/Sets the horizonal alignment of the pager (left/right/center)
PagerShowOnTop Boolean Gets/Sets a value indicating wether or not you want the pager to also be displayed on top of the grid.
CurrentRow Int Gets the current row being rendered.
CurrentColumn Int Gets the current column being rendered.
ColumnsCount Int Gets the number of columns.
RowDataBound String The name of the function to be called before rendering a row. The function has to have the following prototype TheFunction(RowContext) where RowContext is of type DataGridRowContext

Public Methods
(default) Render Renders the control to the page.
SetGridColumns(value) Sets the datagrid coumns. You can also do it directly using the Columns property. The difference is that this method sets the OrdinalPosition right away.
GenerateColumns Generates the DataGridColumn out of the DataSource.
GetColumnByName(DataTextField) Gets a column by field name.
CreateColumns( Array(FieldNames), Array(HeaderNames) Creates the grid columns  using the field names and header texts supplied in the parameters.
Render Renders the DataGrid.

Public Events
PageIndexChange(ClientEvent) Triggered when the user navigates the pager.

Protected Properties
-- -- --

Protected Methods
WriteProperties(bag) Invoked by the CLASP Framework to allow the control to restore its state after a postback. Bag is of type PropertyBag and can be used to read (or write) to the control viewstate.
ReadPropertied(bag) Invoked by the CLASP Framework to allow the control to persist its state before the page is destroyed. Bag is of type PropertyBag and can be used to read (or write) to the control viewstate.
RenderPager Renders the pager.

Protected Events
HandleClientEvent Invoked by the CLASP Framework to allow the control to handle the postback event. From here the control can determine what is the course of action. In this case, if OnClick <> "" then it will invoke the function specified in the property, else it will invoke the default handler, if any.
OnInit Used to initialize the internal pager object. Inherited from WebControl and invoked by telling CLASP that ImplementsOnLoad = True