Class wwWebDataGrid
The wwWebDataGrid provides a cursor based, read-only 'grid' control for displaying data in columnar format.
The DataGrid can display data either based on the current database structure by auto-generating columns from the data source, or you can create custom column layouts to describe the layout. Databinding can be done via powerful FoxPro expressions that are rendered for each column and can be executed dynamically to produce sophisticated layouts and rendering.
For more details on how the DataGrid works check the wwWebDataGrid How To's section.
Class Members
Member | Description | |
---|---|---|
![]() |
PageIndexChanged | Default handler always fires and sets the page index. Note prior to this event (OnLoad) the page index is is not current |
![]() |
SortOrderChanged | Fires when the SortOrder header is clicked and the page order is changed. You can t |
![]() |
RowRender | Fires just before an item row is rendered in the DataGrid. You can optionally return the full content of the row as a string. The event is fired before any output for the row is generated and if you… |
![]() |
AddControl | Overridden AddControl method that allows adding Column objects to the DataGrid. **Script Code:** ```html ``` **Fox Code:** ```foxpro THIS.gdCustomers =…
o.AddControl(loCtl)
|
![]() |
RemoveColumn | Removes a column properly from the DataGrid. Note that you should call this method instead of: grid.Columns.Remove() in order to properly hande cleanup.
o.RemoveColumn(lcColumnId)
|
![]() |
DataBind | Databinds the DataGrid. Unlike some other list controls you should always call DataBind() to ensure that internal settings get updated properly for binding. This includes page counts, sort orders etc.
o.DataBind()
|
![]() |
AlternatingItemCssClass | The CSS Class used on Alternating Rows. |
![]() |
ActiveColumn | The active grid column object instance during databinding. This property can be used to get access to the individual column that is current active for databinding. This property is merely a short… |
![]() |
ActiveColumnAttributeString | The content of the column's ItemAttributeString that is used to render the current column. This value can be safely overridden in any databinding (ControlSource) or formatting expression to affect… |
![]() |
AutoGenerateColumns | Automatically generates all columns if set to .t. |
![]() |
CellPadding | The CellPadding for the HTML table. |
![]() |
Columns | Collection of [wwWebGridColumn](vfps://Topic/_1MW0ZSIK5) items that contain the behaviors for each to the Columns that are displayed. Columns are added using the… |
![]() |
CurrentPageIndex | |
![]() |
DataSource | The name of a cursor or table that we are binding to. |
![]() |
DataKeyField | When specified causes each row to be rendered with an id expression that includes the evaluated expression. This can be useful for client side script code to pass state information to the server for… |
![]() |
HeaderCssClass | The CSS Class used for the List Header. |
![]() |
ItemCssClass | The CSS Class used for displaying normal rows. By default no Class is applied so the default table class/styles are used. |
![]() |
PageCount | Number of total pages for datasource based on the PageCount. This property gets set after DataBind() has been called and is set only if PageSize is greater than 0. Typically you can look at this… |
![]() |
PagerColumnAttributes | Any custom attributes you might need to set on the page column. |
![]() |
PagerCssClass | The CSS Class used in the Pager row of the table. Note that the main pager's css class is .gridpager. This class is configurable by this property. There are additional non-configurable styles that… |
![]() |
PagerText | The text displayed before the actual page display. Defaults to *Pages:*. |
![]() |
PageSize | Size of the Page to display. If non-zero causes the DataGrid to add a Pager band to the bottom of the list that allows the user to select a different page. |
![]() |
RowContent | Can be assigned to inside of the [RowRender event](vfps://Topic/_1P80YKL4Z) to completely override rendering of an individual row. If set the full row including the tags must be rendered in the text… |
![]() |
RowAttributeString | A complete attribute string that can be applied to the tag of the data items. This method is very useful if you override the RowRender event, to allow custom coloring of rows for example by… |
![]() |
SortColumn | Internal property used to keep track which column name is currently sorted. The value is the name of the column. |
![]() |
SortOrder | Returns the current direction of the Sorting that might be active. Either empty or "DESC". |
Example
Script Code:
html
html
<ww:wwWebDataGrid ID="gdCustomers" runat="server" PageSize="10">
<Columns>
<ww:wwWebDataGridColumn runat="server" id="colCompany" Expression="Company" HeaderText="Company" />
<ww:wwWebDataGridColumn runat="server" id="colCareOf" Expression="CareOf" HeaderText="Name" />
</Columns>
</ww:wwWebDataGrid>
Fox Code:
foxpro
foxpro
THIS.gdCustomers = CREATEOBJECT("wwwebdatagrid",THIS)
THIS.gdCustomers.Id = "gdCustomers"
THIS.gdCustomers.PageSize = 10
THIS.AddControl(THIS.gdCustomers)
THIS.colCompany = CREATEOBJECT("wwwebdatagridcolumn",THIS)
THIS.colCompany.Id = "colCompany"
THIS.colCompany.Expression = [Company]
THIS.colCompany.HeaderText = [Company]
THIS.colCompany.UniqueId = [gdCustomers_colCompany]
THIS.gdCustomers.AddControl(THIS.colCompany)
THIS.colCareOf = CREATEOBJECT("wwwebdatagridcolumn",THIS)
THIS.colCareOf.Id = "colCareOf"
THIS.colCareOf.Expression = [CareOf]
THIS.colCareOf.HeaderText = [Name]
THIS.colCareOf.UniqueId = [gdCustomers_colCareOf]
THIS.gdCustomers.AddControl(THIS.colCareOf)
© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic