Click or drag to resize
BasicDataGrid Class
Extended version of DataGrid class that automates databinding, sorting and paging.
Inheritance Hierarchy

Namespace: CMS.Controls
Assembly: CMS.Controls (in CMS.Controls.dll) Version: 9.0.0
Syntax
C#
public class BasicDataGrid : UIDataGrid, 
	IRelatedData

The BasicDataGrid type exposes the following members.

Constructors
  NameDescription
Public methodBasicDataGrid
Constructor.
Top
Fields
  NameDescription
Protected fieldmOnBeforeInitFired
True if the on before init was fired.
Protected fieldmRelatedData
Custom data connected to the object.
Protected fieldmRelatedDataLoaded
Related data is loaded.
Top
Properties
  NameDescription
Public propertyDataBindByDefault
Indicates whether data binding should be performed by default.
Public propertyDataSource
Gets or sets the object from which data-bound control retrieves its list of data item.
(Inherited from UIDataGrid.)
Public propertyHideControlForZeroRows
Hides the control when no data is loaded. Default value is False.
Public propertyProcessSorting
Indicates if sorting should be processed in DataView instead of sorting on the SQL level.
Public propertyRelatedData
Custom data connected to the object, if not set, returns the Related data of the nearest IDataControl.
Public propertySetFirstPageAfterSortChange
Indicates if page index is set to the first page after sort change.
Public propertyShortID
Short ID of the control.
(Inherited from UIDataGrid.)
Public propertySortAscending
Direction of sorting. Default value is True.
Public propertySortField
Gets or sets the sort field. It can be used for setting the default sort field.
Public propertyZeroRowsText
Text to be shown when control is hidden by HideControlForZeroRows.
Top
Methods
  NameDescription
Protected methodControl_PreRender
Control prerender code.
Public methodDataBind
Binds data to the grid and displays the sorting symbols.
(Overrides BaseDataListDataBind.)
Public methodGetPagerMode
Returns the pager position based on the given string.
Protected methodOnInit
Initializes the control.
(Overrides UIDataGridOnInit(EventArgs).)
Protected methodOnLoad
OnLoad event handler. It automatically binds data unless DataBindByDefault is false.
(Overrides BaseDataListOnLoad(EventArgs).)
Protected methodOnPageIndexChanged
OnPageIndexChanged event handler. It ensures displaying of the given page.
(Overrides DataGridOnPageIndexChanged(DataGridPageChangedEventArgs).)
Protected methodOnPreRender
PreRender event handler
(Inherited from UIDataGrid.)
Protected methodOnSortCommand
OnSortCommand event handler. It sorts data by selected column.
(Overrides DataGridOnSortCommand(DataGridSortCommandEventArgs).)
Protected methodRaiseOnBeforeInit
Raises the OnBeforeInit event.
Protected methodRender
Render event handler, to maintain the proper control rendering.
(Overrides BaseDataListRender(HtmlTextWriter).)
Top
Extension Methods
  NameDescription
Public Extension MethodAddCssClass
Adds CSS class to control. If class is already present, than adding is skipped. Class names are case sensitive.
(Defined by ControlsExtensions.)
Public Extension MethodCallHandled
Calls the method handled by the exception handler. If the call doesn't succeed, the problem is reported through parent IExceptionHandler control instead of throwing unhandled exception for the entire page. Returns true, if the call succeeded, otherwise returns false.
(Defined by ControlsExtensions.)
Public Extension MethodGetCssClasses
Returns all CSS classes of control.
(Defined by ControlsExtensions.)
Public Extension MethodGetRenderedHTML
Returns HTML which would be rendered by control to page.
(Defined by ControlsExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by ControlsExtensions.)
Public Extension MethodHasCssClass
Checks whether the control has given CSS class. Class names are case sensitive.
(Defined by ControlsExtensions.)
Public Extension MethodRemoveCssClass
Removes all occurrences. Class names are case sensitive.
(Defined by ControlsExtensions.)
Public Extension MethodSetCssClasses
Sets CSS classes to the control. Current classes will be overridden.
(Defined by ControlsExtensions.)
Top
Events
  NameDescription
Public eventOnBeforeInit
On before init handler.
Top
See Also