ItemInserted Event
Fired when an automatic insert operation is executed.
Event Parameters
-
(object)
sender- The control that fires the event
-
(GridInsertedEventArgs)
e-
Event arguments
-
(int)
e.AffectedRowsGets the rows affected from the operation that changed the
RadGrid
data. -
(Exception)
e.ExceptionGets the exception related with the operation. The property value will be 'null' if no exception occured durring the operation.
-
(bool)
e.ExceptionHandledGets or sets a value which if set to 'true' and exception was thrown will cause the
RadGrid
to skip throwing the exception and will let the user handle it. -
(GridEditableItem)
e.ItemGets the
GridEditableItem
which caused the event. -
(bool)
e.KeepInInsertModeGets or sets a value determining if the GridEditableItem which fired the event will stay in insert mode after the postback.
-
-
Attaching the event
In the Markup
<telerik:RadGrid ID="RadGrid1" runat="server" OnItemInserted="RadGrid1_ItemInserted">
</telerik:RadGrid>
In the Code behind
protected void Page_Init(object sender, EventArgs e)
{
RadGrid1.ItemInserted += RadGrid1_ItemInserted;
}
The event handler
protected void RadGrid1_ItemInserted(object sender, GridInsertedEventArgs e)
{
int affectedRows = e.AffectedRows;
Exception exception = e.Exception;
bool exceptionHandled = e.ExceptionHandled;
GridEditableItem item = e.Item;
bool keepInInsertMode = e.KeepInInsertMode;
}