我在运行时创建了一个gridview,但是我没有创建命令按钮事件。我的问题与devexpress row deleting event类似,但我没有使用它:/这是我的代码:
在我的Page_Load功能中:
ASPxGridView grid = new ASPxGridView();
grid.ID = "ASPxGridView1";
Page.Form.Controls.Add(grid);
GridViewCommandColumn cIslem = new GridViewCommandColumn("İşlem");
cIslem.EditButton.Visible = true;
cIslem.DeleteButton.Visible = true;
cIslem.NewButton.Visible = true;
grid.Columns.Add(cIslem);
GridViewDataTextColumn cID = new GridViewDataTextColumn();
cID.Name = "ID";
cID.Caption = "ID";
cID.FieldName = "ID";
cID.ReadOnly = true;
cID.Visible = false;
grid.Columns.Add(cID);
GridViewDataTextColumn cName = new GridViewDataTextColumn();
cName.Name = "Name";
cName.Caption = "Name";
cName.FieldName = "Name";
cName.ReadOnly = true;
cName.CellStyle.HorizontalAlign = HorizontalAlign.Center;
grid.Columns.Add(cName);
grid.SettingsBehavior.AllowFocusedRow = true;
grid.KeyFieldName = "ID";
DataTable dt = new DataTable("Veri");
dt.Columns.Add("ID");
dt.Columns.Add("Name");
DataRow dr = dt.NewRow();
dr["Name"] = "ABC";
dr["ID"] = "1";
dt.Rows.Add(dr);
grid.DataSource = dt;
grid.DataBind();
grid.RowDeleting += new DevExpress.Web.Data.ASPxDataDeletingEventHandler(grd_RowDeleting);
当我点击删除按钮时,我给出了错误:
“无法找到回调的目标'ASPxGridView1'或未实现ICallbackEventHandler”
我该如何解决?