RadGrid for ASP.NET AJAX

RadControls for ASP.NET AJAX

There are two ways to attach handler to a client-side event of RadGrid:

  • attach command string to event

    CopyASPX
    <ClientEvents OnGridCreating="alert('Creating RadGrid')">
  • attach function to event:

    CopyJavaScript
    <ClientEvents OnGridCreating = "GridCreating">
    <script type="text/javascript">
        function GridCreating(sender, eventArgs){
            alert("Creating grid with ClientID: " + sender.get_id());
        }
    </script>

You can also attach handlers dynamically with the following code:

CopyJavaScript
grid.add_eventName(eventHandler);          

function eventHandler(sender, args) {
   //...
}

Here eventName is formed from the names in the table below by removing On and starting with a small letter. For example, attaching an event handler for OnRowContextMenu will look in the following way:

CopyJavaScript
grid.add_rowContextMenu(eventHandler);
Note

Please note that the grid and its structure should be created when the event handlers are attached. That is why you cannot attach handlers for the OnXXXCreating and OnXXXCreated events dynamically.

Inside each RadGrid client-side event handler the first argument passed (sender) will point to the grid client object. The second argument (eventArgs) will hold reference properties/objects dependable on the respective client event. They are listed in the separate help topics linked in the next paragraph.

OnActiveRowChanging

String

OnActiveRowChanged

String

OnColumnClick

String

OnColumnContextMenu

String

OnColumnCreating

String

OnColumnCreated

String

OnColumnDblClick

String

OnColumnDestroying

String

OnColumnHiding

String

OnColumnHidden

String

OnColumnMouseOut

String

OnColumnMouseOver

String

OnColumnMovingToLeft

String

OnColumnMovedToLeft

String

OnColumnMovingToRight

String

OnColumnMovedToRight

String

OnColumnResizing

String

OnColumnResized

String

OnColumnShowing

String

OnColumnShown

String

OnColumnSwapping

String

OnColumnSwapped

String

OnCommand

String

OnDataBinding

String, meaningful only when RadGrid is bound client-side

OnDataBindingFailed

String, meaningful only when RadGrid is bound client-side

OnDataBound

String, meaningful only when RadGrid is bound client-side

OnDataSourceResolved

String, meaningful only when RadGrid is bound client-side

OnFilterMenuShowing

String

OnGridCreating

String

OnGridCreated

String

OnGridDestroying

String

OnGroupCollapsing

String, meaningful only when GroupLoadMode="Client"

OnGroupCollapsed

String, meaningful only when GroupLoadMode="Client"

OnGroupExpanding

String, meaningful only when GroupLoadMode="Client"

OnGroupExpanded

String, meaningful only when GroupLoadMode="Client"

OnHeaderMenuShowing

String

OnHierarchyCollapsing

String, meaningful only when HierarchyLoadMode="Client"

OnHierarchyCollapsed

String, meaningful only when HierarchyLoadMode="Client"

OnHierarchyExpanding

String, meaningful only when HierarchyLoadMode="Client"

OnHierarchyExpanded

String, meaningful only when HierarchyLoadMode="Client"

OnKeyPress

String

OnMasterTableViewCreating

String

OnMasterTableViewCreated

String

OnPopUpShowing

String

OnRowClick

String

OnRowContextMenu

String

OnRowCreating

String

OnRowCreated

String

OnRowDataBound

String

OnRowDblClick

String

OnRowDeleting

String, meaningful only when GridClientDeleteColumn is used for deleting

OnRowDeleted

String, meaningful only when GridClientDeleteColumn is used for deleting

OnRowDeselecting

String

OnRowDeselected

String

OnRowDestroying

String

OnRowDragStarted

String

OnRowDropping

String

OnRowDropped

String

OnRowHiding

String

OnRowHidden

String

OnRowMouseOut

String

OnRowMouseOver

String

OnRowResizing

String

OnRowResized

String

OnRowSelecting

String

OnRowSelected

String

OnRowShowing

String

OnRowShown

String

OnTableCreating

String

OnTableCreated

String

OnTableDestroying

String

OnScroll

String

Caution

Note that when the ClientIDMode property of the RadGrid control is set to Static, all row specific client-side events would not fire.