0

I created a gridview at runtime but I did not create command button events. My question is sosimilar to devexpress row deleting event, but I did not worked it :/ Here is my code:

In my Page_Load Function:

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);

When I click the delete button, I gave the error:

"The target 'ASPxGridView1' for the callback could not be found or did not implement ICallbackEventHandler"

Error image

How can I fix it?

Community
  • 1
  • 1
user983924
  • 395
  • 2
  • 10
  • 23

0 Answers0