Server-Side Programming Overview
For a list with the server-side properties and methods of the control, see the Server-Side API of the RadGrid class. You can also find it in the intellisense in Visual Studio.
For instructions and examples for a server-side approach to access Cells, Values, Controls and more in RadGrid, visit the: Accessing Values and Controls article.
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.ColumnGroups | A collection of type GridColumnGroupCollection which holds the multiheaders in the GridTableView |
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 (sorted by categories).
Command events
-
Fired when the Cancel button is clicked for an item in the RadGrid control.
-
Fired when the Delete button is clicked for an item in the RadGrid control.
-
Fired when the Edit button is clicked for an item in the RadGrid control.
-
Fired when the Update button is clicked for an item in the RadGrid control.
-
Fired when the Insert button is clicked for an item in the RadGrid control.
-
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
-
Fired when saving the changes if the data is bound on the server and the EditMode of the Grid is set to Batch.
Behavior
-
Fired on the server when an item in the RadGrid control is created.
-
Fired after an item is databound to the RadGrid control.
-
Fired when one of the page selection elements is clicked.
-
Fired when the page size is changed through the advanced pager or manually in code
-
SelectedIndexChanged (inherited from GridBaseDataList )
Fired when a different item is selected in a data listing control between posts to the server.
-
Marked for internal usage.
-
This event is fired after the creation of auto-generated columns.
-
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
-
Fired when Telerik RadGrid tries to group its data (e.g. when a column header is dragged to the Group Panel).
-
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.
-
Fired when column reorder occurs (only when ClientSettings -> ReorderColumnsOnClient is set to false!)
Data binding
-
DataBinding (inherited from Control)
Fired right before the server control binds to a data source. This event will fire only once, when RadGrid is initially binding.
-
DataBound (inherited from Control)
Fired when the server control is bound to a data source.
-
Fired when RadGrid needs a data source for rebinding.
-
Fired when a table from DetailTablesCollection binds to a data source.
Automatic CRUD operations with Declarative DataSource controls
-
Fired when an automatic delete operation is executed.
-
Fired when an automatic update operation is executed.
-
Fired when an automatic insert operation is executed.
Row Drag&Drop
-
Fired when drag and drop operation is triggered from the client
Exporting
-
Fired when RadGrid is exported to Excel/Word/Csv/Pdf before the resulting document is rendered on the client.
-
Fired when RadGrid is exported to Pdf before the resulting document is rendered on the client. Appropriate for customizing the grid table appearance in the .pdf document.
-
Fired when RadGrid is exported to Excel before the resulting document is rendered on the client.
-
Fired when RadGrid is exported to native Excel before the OnExcelMLExportRowCreated event.
-
Fired when RadGrid is exported to native Excel before the resulting document is rendered on the client.
Miscellanious
-
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.
-
Fired when the server control is initialized, which is the first step in its lifecycle.
-
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.