AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

AdvantageGrid Methods

The AdvantageGrid type exposes the following members.

Methods


  Name Description
Public method Static member EmptySortedList<(Of <<'(T>)>>)
Returns a new empty List of the same element type as myObjectList. The input is used purely for type inference and is not read; equivalent to new List<T>() but lets callers avoid restating the type argument.
Public method Static member GetRecordFromList<(Of <<'(T>)>>)
Locates a record in myObjectList whose properties match every GridDataKeyValue in keyCritera. Used by event handlers to resolve Item back to the original entity in the caller's source list.
Public method grdItems_ItemCommand
Translates Telerik grid commands (InitInsert, Select, Delete, Active/InActive, Featured/NotFeatured) into the strongly-typed OnLoadObject, OnDeleteObject, OnToggleActive, OnToggleFeature events. Cancels Telerik's built-in insert flow on the Add button — the host is expected to raise its own edit form instead.
Protected method grdItems_RowDrop
Builds the post-drop ordering and raises OnReordered. Walks the destination table view, swapping the dragged and target rows according to GridItemDropPosition, and emits the new sequence as Items. No-ops when the drop occurs on an external HTML element.
Protected method grdListItems_PreRender
Materialises the user's Columns into Telerik GridBoundColumn instances inserted between the auto-generated Edit column (index 0) and the Active/Feature/Delete trio (last 3). Also applies ShowEditFunction, ShowDeleteFunction and the active/feature column visibility derived from whether handlers are attached.
Protected method OnInit
Applies grid configuration, adds the four template columns (Edit / Feature / Active / Delete), wires ItemCommand, ItemDataBound and RowDrop to the internal handlers, and honours DisableSorting before deferring to the base implementation.
Protected method OnLoad
Re-applies the current DataKeyNames to MasterTableView.DataKeyNames at OnLoad. This is the closing of a timing gap: the same assignment runs in InitializeControl()()()() (during OnInit, picks up markup-set values) and in grdListItems_PreRender(Object, EventArgs) (catches anything set after Load). The OnInit pass alone misses code-behind values written by the host in its own OnInit body, Page_Load, or grid-property setter calls in load-time code — those run AFTER the child grid's OnInit because child OnInit cascades before parent OnInit. Setting at OnLoad here, AFTER LoadViewState and AFTER the host's own OnLoad / Page_Load has cascaded down, makes [MasterTableView.DataKeyNames] reflect the configured value before ItemCommand and other postback events fire — so event args land with the right DataField entries for the host's resolve-row-from-keys logic.
Protected method OnPreRender
Synchronises the toolbar buttons with the Show… flags, materialises the user's Columns definitions into Telerik GridBoundColumn instances, and triggers a final Rebind()()()() so the grid renders with the latest data.