Torna al Thread

GridView GridViewProdottiGruppo(string id_cat) { GridView grwProdottiGruppo = new GridView(); grwProdottiGruppo.ID = "grwProdottiGruppo"; grwProdottiGruppo.BackColor = Color.White; grwProdottiGruppo.EmptyDataText = "Nessun Prodotto Presente"; grwProdottiGruppo.EmptyDataRowStyle.CssClass = "testo"; grwProdottiGruppo.EmptyDataRowStyle.BackColor = Color.White; grwProdottiGruppo.EmptyDataRowStyle.HorizontalAlign = HorizontalAlign.Center; grwProdottiGruppo.AutoGenerateColumns = false; grwProdottiGruppo.BorderWidth = Unit.Pixel(0); grwProdottiGruppo.CellPadding = 1; grwProdottiGruppo.CellSpacing = 1; grwProdottiGruppo.ShowHeader = true; grwProdottiGruppo.AllowPaging = true; grwProdottiGruppo.AllowSorting = true; grwProdottiGruppo.DataKeyNames = new string[] { "id_prodotto" }; grwProdottiGruppo.SelectedIndexChanged += new EventHandler(grwProdottiGruppo_SelectedIndexChanged); grwProdottiGruppo.SelectedIndexChanging += new GridViewSelectEventHandler(grwProdottiGruppo_SelectedIndexChanging); grwProdottiGruppo.RowDataBound += new System.Web.UI.WebControls.GridViewRowEventHandler(this.grwProdottiGruppo_RowDataBound); grwProdottiGruppo.RowCreated += new System.Web.UI.WebControls.GridViewRowEventHandler(this.grwProdottiGruppo_RowCreated); grwProdottiGruppo.PageIndexChanging += new System.Web.UI.WebControls.GridViewPageEventHandler(this.grwProdottiGruppo_PageIndexChanging); grwProdottiGruppo.Sorting += new System.Web.UI.WebControls.GridViewSortEventHandler(this.grwProdottiGruppo_Sorting); grwProdottiGruppo.RowStyle.CssClass = "testo"; grwProdottiGruppo.RowStyle.BackColor = Color.White; grwProdottiGruppo.HeaderStyle.BackColor = Color.FromArgb(0, 150, 209); //colonna seleziona TemplateField tfSeleziona = GridViewClass.TemplateFieldCheckBox(string.Empty,16, "testo_white", "ckSeleziona"); //codice prodotto BoundField bfCodiceProdotto = GridViewClass.CreateBoundField("codice_prodotto", true, "testo_white", "cod. prod.", "codice_prodotto", HorizontalAlign.Center, HorizontalAlign.Left, 80); //prodotto BoundField bfProdotto = GridViewClass.CreateBoundField("prodotto", true, "testo_white", "prodotto", "prodotto", HorizontalAlign.Center, HorizontalAlign.Left, 150); //fornitore BoundField bfFornitore = GridViewClass.CreateBoundField("fornitore", true, "testo_white", "fornitore", "fornitore", HorizontalAlign.Center, HorizontalAlign.Left, 104); //costo BoundField bfCosto = GridViewClass.CreateBoundField("costo", true, "testo_white", "costo €", "costo", HorizontalAlign.Center, HorizontalAlign.Right, 60); //costo attivazione BoundField bfCostoAttivazione = GridViewClass.CreateBoundField("costo_attivazione", true, "testo_white", "attivazione €", "costo_attivazione", HorizontalAlign.Center, HorizontalAlign.Right, 60); //tipologia costo BoundField bfScadenza = GridViewClass.CreateBoundField("tipologia_costo", true, "testo_white", "scadenza", "tipologia", HorizontalAlign.Center, HorizontalAlign.Left, 60); //costo personalizzato TemplateField tfCosto = GridViewClass.TemplateFieldTextBox("costo","costo €", 60, TextBoxMode.SingleLine, 7, 1, 6, "testo", "testo_white", clsCostanti.SCRIPT_INPUT_DECIMAL, "txtCosto"); //costo personalizzato TemplateField tfCostoAttivazione = GridViewClass.TemplateFieldTextBox("costo_attivazione", "attivazione €", 60, TextBoxMode.SingleLine, 7, 1, 6, "testo", "testo_white", clsCostanti.SCRIPT_INPUT_DECIMAL, "txtCostoAttivazione"); //colonna adatta TemplateField tfAdatta = GridViewClass.TemplateFieldCheckBox("adatta", 40, "testo_white", "ckAdatta"); //colonna default TemplateField tfDefault = GridViewClass.TemplateFieldCheckBox("default", 40, "testo_white", "ckDefault"); grwProdottiGruppo.Columns.Add(tfSeleziona); grwProdottiGruppo.Columns.Add(bfCodiceProdotto); grwProdottiGruppo.Columns.Add(bfProdotto); grwProdottiGruppo.Columns.Add(bfFornitore); grwProdottiGruppo.Columns.Add(bfCosto); grwProdottiGruppo.Columns.Add(bfCostoAttivazione); grwProdottiGruppo.Columns.Add(bfScadenza); grwProdottiGruppo.Columns.Add(tfCosto); grwProdottiGruppo.Columns.Add(tfCostoAttivazione); grwProdottiGruppo.Columns.Add(tfAdatta); grwProdottiGruppo.Columns.Add(tfDefault); string id_categorie_foglia = clsProdotti.getNodiFigli(id_cat); grwProdottiGruppo.DataSource = clsProdotti.ProdottiInsiemeCategorie(id_categorie_foglia, "ON"); grwProdottiGruppo.DataBind(); return grwProdottiGruppo; }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5