Esempio n. 1
0
        protected void gvFeatureItemList_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView gridView = sender as ASPxGridView;

            OptionItem optionItem = new OptionItem();

            optionItem.Name        = e.NewValues["Name"].ToString().Trim();
            optionItem.Description = e.NewValues["Description"].ToString().Trim();
            // optionItem.IsDeleted = Convert.ToBoolean(e.NewValues["IsDeleted"].ToString().Trim());
            optionItem.OptionId  = Convert.ToInt16(e.NewValues["OptionId"].ToString().Trim());
            optionItem.CreatedBy = (Guid)Membership.GetUser().ProviderUserKey;
            optionItem.UpdatedBy = (Guid)Membership.GetUser().ProviderUserKey;

            gridView.CancelEdit();
            e.Cancel = true;

            if (optionItem.Save())
            {
                //Show Success message
            }
            else
            {
                //Error message
            }
            Session[Constants.SESSION_FEATURE_ITEMS_LIST] = new OptionItemDAO().SelectAllDataset();
            LoadGrid();
        }