Torna al Thread

protected void RepeaterAttributiItemDataBound(object sender, RepeaterItemEventArgs e) { Repeater rptDemo = sender as Repeater; // Get the Repeater control object. try { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlTableCell cell = (System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("TableDataCell"); MELCAL_BL.Componenti_Main_Attributo cma = (MELCAL_BL.Componenti_Main_Attributo)e.Item.DataItem; if (Convert.ToInt32(cma.CMA_TIPO.Valore) == MELCAL_DL.Core360Lib.CMA_ATTR_OBJ.CheckBox.GetHashCode()) { CheckBox CheckBox1 = new CheckBox(); CheckBox1.ID = "CheckBox" + cma.CMA_ID.Valore.ToString(); CheckBox1.Checked = Convert.ToBoolean(cma.CMA_VALORE_BOOL.Valore); cell.Controls.Add(CheckBox1); } else if (Convert.ToInt32(cma.CMA_TIPO.Valore) == MELCAL_DL.Core360Lib.CMA_ATTR_OBJ.ComboBoxAjax.GetHashCode()) { AjaxControlToolkit.ComboBox ComboBox1 = new AjaxControlToolkit.ComboBox(); ComboBox1.DropDownStyle = AjaxControlToolkit.ComboBoxStyle.DropDown; ComboBox1.AutoCompleteMode = AjaxControlToolkit.ComboBoxAutoCompleteMode.Suggest; ComboBox1.Attributes.Add("class", "CustomComboBoxStyle"); ComboBox1.ID = "ComboBox" + cma.CMA_ID.Valore.ToString(); Combo_Value cvl = new Combo_Value(); ComboBox1.DataTextField = "myCVL_DESCR"; ComboBox1.DataValueField = "myCVL_ID"; ComboBox1.DataSource = Combo_ValueBL.List((int) cma.CMA_CBO_ID.Valore); ComboBox1.DataBind(); //TODO: Qui fare il controllo se la voce è stata forzata ComboBox1.Text = cma.CMA_VALORE_STRING.Valore.ToString(); ComboBox1.SelectedValue = cma.CMA_VALORE_INT.Valore.ToString(); cell.Controls.Add(ComboBox1); } else if (Convert.ToInt32(cma.CMA_TIPO.Valore) == MELCAL_DL.Core360Lib.CMA_ATTR_OBJ.RadioButtonList.GetHashCode()) { } else if (Convert.ToInt32(cma.CMA_TIPO.Valore) == MELCAL_DL.Core360Lib.CMA_ATTR_OBJ.TextBox.GetHashCode()) { TextBox TextBox1 = new TextBox(); TextBox1.ID = "TextBox" + cma.CMA_ID.Valore.ToString(); TextBox1.Text = cma.CMA_VALORE_STRING.Valore.ToString(); cell.Controls.Add(TextBox1); } } } catch (Exception ee) { string s = ee.Message; } }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5