RadGrid for ASP.NET

Getting familiar with server-side API Send comments on this topic.

Glossary Item Box

Classes and Properties

Following is a table of the most important properties you should be aware of when working with RadGrid.

Property

Description

RadGrid.MasterTableView

The main grid table - in the general case, when there is no hierarchy, only RadGrid.MasterTableView is rendered. You can think of this table as if it is the grid itself. MasterTableView and generally all table-views in the hierarchy use the style, client behavior and other settings applied to RadGrid, unless explicitly specified otherwise.

GridTableView.DetailTables

This collection is used for defining the hierarchical structure of RadGrid.

RadGrid.ClientSettings

Set various client-side appearance and behavior options. See
RadGridTable client-side API for details.

RadGrid.*Style

Properties that control the visual appearance of RadGrid and all tables in the hierarchy.

GridDataTable.*Style properties

Properties that control the visual appearance of GridDataTable and all tables in the hierarchy.

GridTableView.GroupByExpressions

Add or remove objects to this collection to set grouping programmatically.

GridTableView.SortExpressions

Add or remove objects to this collection to set sorting programmatically.

GridTableView.Columns
GridTableView.AutoGeneratedColumns
GridTableView.RenderColumns

Properties to access runtime columns. Columns are set by default in design mode.
AutoGeneratedColumns - are automatically generated columns
RenderColumns - all columns - columns+ AutoGenerated (if any) + structure columns - expand/collapse and group-splitters




Instead of setting properties for each GridTableView, you can use RadGrid global properties for:
PageSize, AllowSorting, AllowPaging, AllowCustomPaging, ShowFooter, ShowHeader, BackColor, BorderColor, PagerStyle.
Thus they will be set for each table in the hierarchy, unless specified otherwise.

 

Events

When working with Telerik RadGrid you will probably often use the following events:

Category

Event

Description

Action

CancelCommand

Fired when the Cancel button is clicked for an item in the RadGrid control.

 

DeleteCommand

Fired when the Delete button is clicked for an item in the RadGrid control.

 

EditCommand

Fired when the Edit button is clicked for an item in the RadGrid control.

 

UpdateCommand

Fired when the Update button is clicked for an item in the RadGrid control.

InsertCommand

Fired when the Insert button is clicked for an item in the RadGrid control.

 

ItemCommand

Fired when any button is clicked in the RadGrid control. All bubbled events from grid items fire RadGrid.ItemCommand. Those like - Edit, Delete, or Update command events can be used to handle custom data-editing in RadGrid.
Expand/Collapse items in the hierarchy or GridGroupHederItem-s (if grid displays grouped items), also fired after binding of detail tables, etc.

 

SortCommand

Fired when a column is sorted. To determine the new/previous sort order on sort command, check the values for the e.NewSortOrder and e.OldSortOrder arguments.

 

PageIndexChanged

Fired when one of the page selection elements is clicked.

 

SelectedIndexChanged(inherited from GridBaseDataList)

Fired when a different item is selected in a data listing control between posts to the server.

 

NeedDataSource

Fired when RadGrid needs a data source for rebinding.

GroupsChanging

Fired when Telerik RadGrid tries to group its data (e.g. when a column header is dragged to the Group Panel).

Behavior

ItemCreated

Fired on the server when an item in the RadGrid control is created.

 

ItemDataBound

Fired after an item is databound to the RadGrid control.

 

ItemEvent

Marked for internal usage

ColumnCreated

This event is fired after the creation of auto-generated columns.
ColumnCreating Fires before a custom column is created. You can handle the event to replace or modify the instance of the column that should be created and added into the collection of column in the corresponding GridTableView.
CreateColumnEditor Fired after the NeedDataSource event of the grid (which is raised right after the PageLoad event) and before any postback events for controls on the page/user control.

Data

DataBinding(inherited from Control)

Fired right before the server control binds to a data source.

 

DataBound(inherited from Control)

Fired when the server control is bound to a data source.

 

DetailTableDataBind

Fired when a table from DetailTablesCollection binds to a data source.

Automatic data editing operations

ItemDeleted

Fired when an automatic delete operation is executed.

 

ItemUpdated

Fired when an automatic update operation is executed.

 

ItemInserted

Fired when an automatic insert operation is executed.

Misc

Disposed(inherited from Control)

Fired when a server control is released from the memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

 

Init(inherited from Control)

Fired when the server control is initialized, which is the first step in its lifecycle.

 

Load(inherited from Control)

Fired when the server control is loaded into the RadGrid object.

 

PreRender(inherited from Control)

Fired when the server control is about to render to its containing Page object.

 

Unload(inherited from Control)

Fired when the server control is unloaded from the memory.