protected void grid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { this.country = objCountry.GetCountry(Int32.Parse(e.Keys[grid.KeyFieldName].ToString())); if (this.country != null) { this.objCountry.DeleteCountry(country); } grid.CancelEdit(); e.Cancel = true; this.grid.DataSource = objCountry.GetCountrys(); this.grid.DataBind(); }
protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxTextBox text = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox; ASPxTextBox textId = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox; this.country = objCountry.GetCountry(Int32.Parse(textId.Text)); if (this.country != null) { country.name = text.Text; country.isactive = true; this.objCountry.UpdateCountry(country); } grid.CancelEdit(); e.Cancel = true; this.grid.DataSource = objCountry.GetCountrys(); this.grid.DataBind(); }