Share via


WebGrid Class

Displays data on a web page using an HTML table element.

Inheritance Hierarchy

System.Object
  System.Web.Helpers.WebGrid

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

Syntax

'Declaration
Public Class WebGrid
'Usage
Dim instance As WebGrid
public class WebGrid
public ref class WebGrid
type WebGrid =  class end
public class WebGrid

The WebGrid type exposes the following members.

Constructors

  Name Description
Public method WebGrid Initializes a new instance of the WebGrid class.

Top

Properties

  Name Description
Public property AjaxUpdateCallback Gets the name of the JavaScript function to call after the HTML element that is associated with the WebGrid instance has been updated in response to an Ajax update request.
Public property AjaxUpdateContainerId Gets the value of the HTML id attribute that marks an HTML element on the web page that gets dynamic Ajax updates that are associated with the WebGrid instance.
Public property CanSort Gets a value that indicates whether the WebGrid instance supports sorting.
Public property ColumnNames Gets a collection that contains the name of each data column that is bound to the WebGrid instance.
Public property FieldNamePrefix Gets the prefix that is applied to all query-string fields that are associated with the WebGrid instance.
Public property HasSelection Gets a value that indicates whether a row in the WebGrid instance is selected.
Public property IsAjaxEnabled Returns a value that indicates whether the WebGrid instance can use Ajax calls to refresh the display.
Public property PageCount Gets the number of pages that the WebGrid instance contains.
Public property PageFieldName Gets the full name of the query-string field that is used to specify the current page of the WebGrid instance.
Public property PageIndex Gets or sets the index of the current page of the WebGrid instance.
Public property Rows Gets a list that contains the rows that are on the current page of the WebGrid instance after the grid has been sorted.
Public property RowsPerPage Gets the number of rows that are displayed on each page of the WebGrid instance.
Public property SelectedIndex Gets or sets the index of the selected row relative to the current page of the WebGrid instance.
Public property SelectedRow Gets the currently selected row of the WebGrid instance.
Public property SelectionFieldName Gets the full name of the query-string field that is used to specify the selected row of the WebGrid instance.
Public property SortColumn Gets or sets the name of the data column that the WebGrid instance is sorted by.
Public property SortDirection Gets or sets the direction in which the WebGrid instance is sorted.
Public property SortDirectionFieldName Gets the full name of the query-string field that is used to specify the sort direction of the WebGrid instance.
Public property SortFieldName Gets the full name of the query-string field that is used to specify the name of the data column that the WebGrid instance is sorted by.
Public property TotalRowCount Gets the total number of rows that the WebGrid instance contains.

Top

Methods

  Name Description
Public method AddSorter<TElement, TProperty> Adds a specific sort function for a given column.
Public method Bind Binds the specified data to the WebGrid instance.
Public method Column Creates a new WebGridColumn instance.
Public method Columns Returns an array that contains the specified WebGridColumn instances.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetContainerUpdateScript Returns a JavaScript statement that can be used to update the HTML element that is associated with the WebGrid instance on the specified web page.
Public method GetHashCode (Inherited from Object.)
Public method GetHtml Returns the HTML markup that is used to render the WebGrid instance and using the specified paging options.
Public method GetPageUrl Returns a URL that can be used to display the specified data page of the WebGrid instance.
Public method GetSortUrl Returns a URL that can be used to sort the WebGrid instance by the specified column.
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method Pager Returns the HTML markup that is used to provide the specified paging support for the WebGrid instance.
Public method Table Returns the HTML markup that is used to render the WebGrid instance.
Public method ToString (Inherited from Object.)

Top

Remarks

This class represents a helper, which is a component that simplifies web programming in ASP.NET Web Pages. You can use the WebGrid class to organize and display data on a web page by using an HTML table element.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Helpers Namespace