protected void FVProgetto_ModeChanging(Object sender, System.Web.UI.WebControls.FormViewModeEventArgs e)
 {
     if (e.CancelingEdit == true)
     {
         Response.Redirect("projects_lookup_list.aspx");
     }
 }
 protected void FormView1_ModeChanging(object sender, FormViewModeEventArgs e)
 {
     if (e.NewMode != FormViewMode.ReadOnly)
     {
         GridView1.EditIndex = -1;
     }
 }
Beispiel #3
0
		protected virtual void OnModeChanging (FormViewModeEventArgs e)
		{
			if (Events != null) {
				FormViewModeEventHandler eh = (FormViewModeEventHandler) Events [ModeChangingEvent];
				if (eh != null) {
					eh (this, e);
					return;
				}
			}
			if (!IsBoundUsingDataSourceID)
				throw new HttpException (String.Format (unhandledEventExceptionMessage, ID, "ModeChanging"));
		}
Beispiel #4
0
		void ProcessChangeMode (FormViewMode newMode, bool cancelingEdit)
		{
			FormViewModeEventArgs args = new FormViewModeEventArgs (newMode, cancelingEdit);
			OnModeChanging (args);

			if (args.Cancel || !IsBoundUsingDataSourceID)
				return;

			ChangeMode (args.NewMode);

			OnModeChanged (EventArgs.Empty);
		}
		void CancelEdit ()
		{
			FormViewModeEventArgs args = new FormViewModeEventArgs (FormViewMode.ReadOnly, true);
			OnModeChanging (args);
			if (!args.Cancel) {
				EndRowEdit ();
			}
		}
		static void  d_ModeChanging(object sender, FormViewModeEventArgs e)
		{
			if (WebTest.CurrentTest.UserData == null) 
			{
				ArrayList list = new ArrayList ();
				list.Add ("ModeChanging");
				WebTest.CurrentTest.UserData = list;
			}
			else {
				ArrayList list = WebTest.CurrentTest.UserData as ArrayList;
				if (list == null)
					throw new NullReferenceException ();
				list.Add ("ModeChanging");
				WebTest.CurrentTest.UserData = list;
			}
		}
		protected void fvEditor_ModeChanging(object sender, FormViewModeEventArgs e)
		{
			// clear the incident detail binding in the formview
			fvEditor.DataSource = null;
			fvEditor.DataBind();

			// clear the list of changes from the Session
			Session.Remove(CACHED_CHANGEDCOLS);

			lblIncidentAddress.Text = "";

			if (e.CancelingEdit)
				if (tvIncident.Nodes.Count > 0)
				{
					tvIncident.Nodes[0].Select();
					tvIncident_SelectedNodeChanged(sender, new EventArgs());
				}
			SetFocus(tvIncident);
		}
Beispiel #8
0
 protected void FormView1_ModeChanging(object sender, FormViewModeEventArgs e)
 {
     Load_DetailsView(EntityIDhide.Text.ToString());
 }
        private bool HandleUpdateCallback(int affectedRows, Exception ex) {
            FormViewUpdatedEventArgs fea = new FormViewUpdatedEventArgs(affectedRows, ex);
            fea.SetOldValues(_updateOldValues);
            fea.SetNewValues(_updateNewValues);
            fea.SetKeys(_updateKeys);

            OnItemUpdated(fea);
            _updateKeys = null;
            _updateOldValues = null;
            _updateNewValues = null;

            if (ex != null && !fea.ExceptionHandled) {
                // If there is no validator in the validation group that could make sense
                // of the error, return false to proceed with standard exception handling.
                // But if there is one, we want to let it display its error instead of throwing.
                if (PageIsValidAfterModelException()) {
                    return false;
                }
                fea.KeepInEditMode = true;
            }

            if (IsUsingModelBinders && !Page.ModelState.IsValid) {
                fea.KeepInEditMode = true;
            }

            if (!fea.KeepInEditMode) {
                FormViewModeEventArgs eMode = new FormViewModeEventArgs(DefaultMode, false);
                OnModeChanging(eMode);
                if (!eMode.Cancel) {
                    Mode = eMode.NewMode;
                    OnModeChanged(EventArgs.Empty);
                    RequiresDataBinding = true;
                }
            }
            return true;
        }
Beispiel #10
0
        private void HandleNew() {
            FormViewModeEventArgs e = new FormViewModeEventArgs(FormViewMode.Insert, false);
            OnModeChanging(e);

            if (e.Cancel) {
                return;
            }

            if (IsDataBindingAutomatic) {
                Mode = e.NewMode;
                OnModeChanged(EventArgs.Empty);
            }

            RequiresDataBinding = true;
        }
Beispiel #11
0
        private void HandleEdit() {
            if (PageIndex < 0) {
                return;
            }

            FormViewModeEventArgs e = new FormViewModeEventArgs(FormViewMode.Edit, false);
            OnModeChanging(e);

            if (e.Cancel) {
                return;
            }

            if (IsDataBindingAutomatic) {
                Mode = e.NewMode;
                OnModeChanged(EventArgs.Empty);
            }

            RequiresDataBinding = true;
        }
Beispiel #12
0
        private void HandleCancel() {
            bool isBoundToDataSourceControl = IsDataBindingAutomatic;

            FormViewModeEventArgs e = new FormViewModeEventArgs(DefaultMode, true);
            OnModeChanging(e);

            if (e.Cancel) {
                return;
            }

            if (isBoundToDataSourceControl) {
                Mode = e.NewMode;
                OnModeChanged(EventArgs.Empty);
            }

            RequiresDataBinding = true;
        }
Beispiel #13
0
        // FormView.ModeChanging 事件
        protected void fvPerson_ModeChanging(object sender, FormViewModeEventArgs e)
        {
            // 将FormView control切换到新模式
            fvPerson.ChangeMode(e.NewMode);

            // 重新绑定FormView控件以新模式显示数据.
            BindFormView();
        }
		protected virtual void OnModeChanging (FormViewModeEventArgs e)
		{
			if (Events != null) {
				FormViewModeEventHandler eh = (FormViewModeEventHandler) Events [ModeChangingEvent];
				if (eh != null) eh (this, e);
			}
		}
Beispiel #15
0
 private void AddHomeForm_ModeChanging(object sender, FormViewModeEventArgs e)
 {
     //switch (e.NewMode)
     //{
     //    case FormViewMode.Edit:
     //        AddHomeForm.ChangeMode(FormViewMode.Edit);
     //        break;
     //}
 }
        /**
         * This method is triggered when the mode changes. all it does is swap the view of the forms
         * i.e. if we press "edit", we need to switch to "edit mode"
         * if we press "new", we need to switch to "insert mode"
         * if we cancel anytime, we need to switch to nothing
         * */
        protected void PGFV_ModeChanging(Object sender, FormViewModeEventArgs e)
        {
            Int32 ind = -1;
            if (Session["index"] != null)
                ind = (Int32)Session["index"];

            if (e.NewMode == FormViewMode.Edit)
            {
                this.PGFV.ChangeMode(e.NewMode);
                rebindForm(ind); //need this to rebound things
            }
            else if (e.NewMode == FormViewMode.Insert)
            {
                this.PGFV.ChangeMode(e.NewMode);
                //no need to rebound cause we want it to be blank
            }
            if (e.CancelingEdit)
            {
                this.PGFV.ChangeMode(FormViewMode.ReadOnly);
                rebindForm(-1); //rebind to nothing cause we want the form to be hidden
            }
        }
Beispiel #17
0
        /// <devdoc>
        /// <para>Raises the <see langword='ModeChanging'/> event.</para>
        /// </devdoc>
        protected virtual void OnModeChanging(FormViewModeEventArgs e) {
            bool isBoundToDataSourceControl = IsDataBindingAutomatic;

            FormViewModeEventHandler handler = (FormViewModeEventHandler)Events[EventModeChanging];
            if (handler != null) {
                handler(this, e);
            } else {
                if (isBoundToDataSourceControl == false && e.Cancel == false) {
                    throw new HttpException(SR.GetString(SR.FormView_UnhandledEvent, ID, "ModeChanging"));
                }
            }
        }
Beispiel #18
0
 /// <summary>
 /// 在Session中保持insertState防止刷新页面后的重复插入.
 /// </summary>
 protected void fvPersonDetails_ModeChanging(object sender, FormViewModeEventArgs e)
 {
     Session["insertstate"] = (e.NewMode == FormViewMode.Insert);
 }
 protected virtual new void OnModeChanging(FormViewModeEventArgs e)
 {
 }
 protected void UserFormView_ModeChanging(object sender, FormViewModeEventArgs e)
 {
     DataBindUserGridView();
 }
 protected virtual new void OnModeChanging(FormViewModeEventArgs e)
 {
 }
		private void fv_ModeChanging (object sender, FormViewModeEventArgs e)
		{
			modeChanging = true;
		}
 protected void FormViewDetails_ModeChanging(object sender, System.Web.UI.WebControls.FormViewModeEventArgs e)
 {
     this.FormViewDetails.ChangeMode(FormViewMode.Edit);
 }
			public void DoOnModeChanging (FormViewModeEventArgs  e)
			{
				OnModeChanging (e); 
			}
		public void ChangeMode (FormViewMode newMode)
		{
			FormViewModeEventArgs args = new FormViewModeEventArgs (newMode, false);
			OnModeChanging (args);
			if (!args.Cancel) {
				currentMode = args.NewMode;
				OnModeChanged (EventArgs.Empty);
				RequireBinding ();
			}
		}