Exemplo n.º 1
0
        protected void grid_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            this.familyType = objFamily.GetFamilyType(Int32.Parse(e.Keys[grid.KeyFieldName].ToString()));
            if (this.familyType != null)
            {
                this.objFamily.DeleteFamilyType(familyType);
            }

            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objFamily.GetFamilyTypes();
            this.grid.DataBind();
        }
Exemplo n.º 2
0
        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.familyType = objFamily.GetFamilyType(Int32.Parse(textId.Text));

            if (this.familyType != null)
            {
                familyType.name     = text.Text;
                familyType.isactive = true;
                this.objFamily.UpdateFamilyType(familyType);
            }

            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objFamily.GetFamilyTypes();
            this.grid.DataBind();
        }