Hello,
I have inserted a simple grid with batch editing option enabled. When I edit any cell, it gets a red mark at top left (which is of course telling that the cell got edited). But the grid is not firing any event like BatchEditCommand, Insert, Update or Delete after editing the cell. Please let me know what m I missing.
What I want is:
1. Get the data after cell got edited to make changes on my page accordingly.
2. Get the complete datasource of grid after editing for example as dataset or datatable.
Thanks.
Full page :
And C# Code :
I have inserted a simple grid with batch editing option enabled. When I edit any cell, it gets a red mark at top left (which is of course telling that the cell got edited). But the grid is not firing any event like BatchEditCommand, Insert, Update or Delete after editing the cell. Please let me know what m I missing.
What I want is:
1. Get the data after cell got edited to make changes on my page accordingly.
2. Get the complete datasource of grid after editing for example as dataset or datatable.
Thanks.
Full page :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadAjaxManager
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"ConfigurationPanel1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"RadAjaxLoadingPanel1"
></
telerik:RadAjaxLoadingPanel
>
<
telerik:RadGrid
ID
=
"RadGrid1"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
AllowAutomaticInserts
=
"True"
PageSize
=
"10"
OnItemDeleted
=
"RadGrid1_ItemDeleted"
OnItemInserted
=
"RadGrid1_ItemInserted"
OnItemUpdated
=
"RadGrid1_ItemUpdated"
OnPreRender
=
"RadGrid1_PreRender"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"ID"
SortOrder
=
"Ascending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Code"
HeaderStyle-Width
=
"210px"
HeaderText
=
"ProductName"
SortExpression
=
"ProductName"
UniqueName
=
"ProductName"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*This field is required"
Display
=
"Dynamic"
>
</
RequiredFieldValidator
>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
></
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
And C# Code :
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = (A function returning datatable).
}
protected void RadGrid1_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)
{
}
protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
}
protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
{
}
protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
{
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
}