Hello,
Now I am looking into this demo
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx
When I click "Add new record" button, I can see that the delete button in the inserted row is available.
But I cannot see the delete button with my own code.
<%@ Page Language="c#" CodeFile="Default.aspx.cs" Inherits="Telerik.GridExamplesCSharp.DataEditing.BatchEditing.Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html
xmlns
=
'http://www.w3.org/1999/xhtml'
>
<
head
runat
=
"server"
>
<
title
>Telerik ASP.NET Example</
title
>
<
link
href
=
"styles.css"
rel
=
"stylesheet"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"true"
/>
<
div
id
=
"demo"
class
=
"demo-container no-bg"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
PageSize
=
"10"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
OnNeedDataSource
=
"ApiGrid_NeedDataSource"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"ProductID"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"ProductID"
SortOrder
=
"Descending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ProductName"
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
>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
HeaderText
=
"Delete"
HeaderStyle-Width
=
"50px"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
></
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
using System;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace Telerik.GridExamplesCSharp.DataEditing.BatchEditing
{
public class Data
{
public string ProductName { get; set; }
public string ProductID { get; set; }
}
public partial class Default : System.Web.UI.Page
{
/// <
summary
>
/// Process need data source event from ApiGrid.
/// </
summary
>
/// <
param
name
=
"sender"
></
param
>
/// <
param
name
=
"e"
></
param
>
protected void ApiGrid_NeedDataSource( object sender, GridNeedDataSourceEventArgs e )
{
RadGrid1.DataSource = new Data[]
{
new Data()
{
ProductName = "AAA",
ProductID ="111"
},
new Data()
{
ProductName = "AAA",
ProductID ="222"
}
};
}
}
}
Could you please give me some advice?
Thanks.