protected void ButtonUndo_Click(object sender, EventArgs e) { if (GridView2.Rows.Count > 0) { _listFlowActOpt.RemoveAll(f => f.FlowPosition == (dt.Rows.Count)); _listFlowActInput.RemoveAll(f => f.FlowPosition == (dt.Rows.Count)); _listFlowActOutput.RemoveAll(f => f.FlowPosition == (dt.Rows.Count)); if (_listFlowMultiOpt.RemoveAll(f => f.FlowPosition == (dt.Rows.Count)) > 0) { dtOptions.Clear(); AddToDataTableOptions("Add Options..."); BindGridOptions(); } dt.Rows.RemoveAt(dt.Rows.Count - 1); BindGrid(); } //IS IMPORTANT TO KEEP IN 2 IFs, The first modifies the row number, so the second needs to check again if (GridView2.Rows.Count > 0) { String lastNode = dt.Rows[dt.Rows.Count - 1].Field <String>("Id"); SetActionGrid(lastNode); PrepareViews(lastNode); LoadPreviousActionOptions(lastNode); SetRadioControlStyles(); } ButtonRight.Text = "Show Imports"; MultiViewRight.SetActiveView(ViewOptions); }
protected void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e) { // If multiple buttons are used in a GridView control, use the // CommandName property to determine which button was clicked. if (Page.IsValid) { if (e.CommandName == "Select") { WebControl wc = e.CommandSource as WebControl; Button pressedButton = e.CommandSource as Button; GridViewRow row = wc.NamingContainer as GridViewRow; String selectedId = GridView1.DataKeys[row.RowIndex].Value.ToString(); AddToDataTable(pressedButton.Text, selectedId, GetActionInput(selectedId), dt.Rows.Count + 1, GetActionOutput(selectedId)); BindGrid(); if (dt.Rows.Count > 1) { SaveActionOptions(dt.Rows.Count - 1); } if (GridView1.Rows.Count > 0) { SetActionGrid(selectedId); } PrepareViews(selectedId); LoadActionOptions(selectedId); SetRadioControlStyles(); ButtonRight.Text = "Show Imports"; MultiViewRight.SetActiveView(ViewOptions); } } }
protected void ButtonRight_Click(object sender, EventArgs e) { if (ButtonRight.Text == "Show Imports") { ButtonRight.Text = "Hide Imports"; MultiViewRight.SetActiveView(ViewImports); BindGridImports(); } else { ButtonRight.Text = "Show Imports"; MultiViewRight.SetActiveView(ViewOptions); } }
protected void ButtonReset_Click(object sender, EventArgs e) { dt.Rows.Clear(); BindGrid(); SetActionGrid(null); dtOptions.Clear(); AddToDataTableOptions("Add Options..."); BindGridOptions(); _listFlowActOpt.Clear(); _listFlowActInput.Clear(); _listFlowActOutput.Clear(); _listActOpt.Clear(); _listFlowMultiOpt.Clear(); MultiViewGeneral.ActiveViewIndex = -1; ButtonRight.Text = "Show Imports"; MultiViewRight.SetActiveView(ViewOptions); }