protected void gridTemplates_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { //try //{ ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "reallowOp();", true); hfFieldId.Value = ((Label)this.gridTemplates.Rows[e.NewSelectedIndex].FindControl("SYSTEM_ID_TEMPLATE")).Text; if (((CheckBox)this.gridTemplates.Rows[e.NewSelectedIndex].FindControl("chkSelectedTemplate")).Checked) { addTemplateFields(hfFieldId.Value); } else { removeTemplateFields(hfFieldId.Value); } this.gridTemplate_index.Value = "-1"; this.btn_up_field.Enabled = false; this.btn_down_field.Enabled = false; this.hfFieldId.Value = string.Empty; this.upButtons.Update(); gridTemplates.SelectedIndex = e.NewSelectedIndex; this.GridPersonalizzata.DataSource = this.TemporaryGrid.Fields; this.GridPersonalizzata.DataBind(); //ViewDettaglioFiled(string.Empty, this.TemporaryGrid.Fields[e.NewSelectedIndex].Locked); UpnlGrigliaTemplate.Update(); UpnlGrigliaPersonalizzata.Update(); //} //catch (System.Exception ex) //{ // UIManager.AdministrationManager.DiagnosticError(ex); // return; //} }
protected void DownField(object sender, EventArgs e) { //try //{ int position = Convert.ToInt32(this.selectedFieldPosition.Value); Field up = this.TemporaryGrid.Fields[position]; Field down = this.TemporaryGrid.Fields[position + 1]; this.TemporaryGrid.Fields[position] = down; this.TemporaryGrid.Fields[position + 1] = up; this.TemporaryGrid.Fields[position].Position = position; this.TemporaryGrid.Fields[position + 1].Position = position + 1; this.GridPersonalizzata.DataSource = this.TemporaryGrid.Fields; this.GridPersonalizzata.DataBind(); this.selectedFieldPosition.Value = (position + 1).ToString(); if ((GridPersonalizzata.Rows.Count - 1) == (position + 1)) { this.btn_down_field.Enabled = false; } this.btn_up_field.Enabled = true; this.upButtons.Update(); UpnlGrigliaPersonalizzata.Update(); UpnlGrigliaTemplate.Update(); GridPersonalizzata.SelectedIndex = position + 1; //} //catch (System.Exception ex) //{ // UIManager.AdministrationManager.DiagnosticError(ex); // return; //} }
protected void GridPersonalizzata_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { //try //{ ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "reallowOp();", true); this.ddlWidth.SelectedValue = (TemporaryGrid.Fields[e.NewSelectedIndex].Width).ToString(); this.selectedFieldPosition.Value = (e.NewSelectedIndex).ToString(); Label systemIdLabel = (Label)this.GridPersonalizzata.Rows[e.NewSelectedIndex].FindControl("SYSTEM_ID"); this.hfFieldId.Value = systemIdLabel.Text; EnabledButtunUpDown(GridPersonalizzata.Rows[e.NewSelectedIndex]); GridPersonalizzata.SelectedIndex = e.NewSelectedIndex; if ((((CheckBox)GridPersonalizzata.Rows[e.NewSelectedIndex].FindControl("checkDocumento")).Checked)) { ViewDettaglioFiled(TemporaryGrid.Fields[e.NewSelectedIndex].Label, TemporaryGrid.Fields[e.NewSelectedIndex]); SaveCurrentFieldProperties(); } else { ViewDettaglioFiled(string.Empty, null); RemoveCurrentFieldProperties(); } bool IsRoleEnabledToUseGrids = UIManager.UserManager.IsAuthorizedFunctions("GRID_PERSONALIZATION"); if (SelectedGrid.GridType == GridTypeEnumeration.Project) { GridManager.CompileDdlOrderAndSetOrderFilterProjects(this.TemporaryGrid, this.ddlOrder, this.ddlAscDesc, IsRoleEnabledToUseGrids); } else { GridManager.CompileDdlOrderAndSetOrderFilterDocuments(this.TemporaryGrid, this.ddlOrder, this.ddlAscDesc, IsRoleEnabledToUseGrids); } UpnlGrigliaPersonalizzata.Update(); UpnlGrigliaTemplate.Update(); UpPnlDettaglio.Update(); //} //catch (System.Exception ex) //{ // UIManager.AdministrationManager.DiagnosticError(ex); // return; //} }
/// <summary> /// Al clicm su questo pulsante vengono salvate le impostazioni per la griglia corrente /// </summary> protected void GridPersonalizationBtnInserisci_Click(object sender, EventArgs e) { //try //{ ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "reallowOp();", true); SelectedGrid = this.TemporaryGrid; SelectedGrid.FieldForOrder = SelectedGrid.Fields.Where( f => f.FieldId.Equals(this.ddlOrder.SelectedItem.Value)).FirstOrDefault(); // Impostazione della direzione di ordinamento if (this.ddlAscDesc.SelectedValue.ToUpper() == "ASC") { SelectedGrid.OrderDirection = OrderDirectionEnum.Asc; } else { SelectedGrid.OrderDirection = OrderDirectionEnum.Desc; } SelectedGrid.GridId = string.Empty; this.TemporaryGrid = null; UpnlGrigliaPersonalizzata.Update(); upButtons.Update(); upPnlButtons.Update(); UpnlGrigliaTemplate.Update(); close("up"); //} //catch (System.Exception ex) //{ // UIManager.AdministrationManager.DiagnosticError(ex); // return; //} }