/// <summary> /// Crea un control de lista /// </summary> private Control CreateControlList(string strValue) { Combos.ComboBoxExtended cboList = new Combos.ComboBoxExtended(); int intValue = 0; // Obtiene el valor if (!int.TryParse(strValue, out intValue)) { intValue = 0; } //// Carga los elementos de la lista // objColListItems.LoadByIDValue(objValue.ID); //// Asigna las propiedades // if (ModuleValueDefinition.IsRequired) // cboList.BackColor = Color.FromArgb(255, 255, 192); //// Muestra los elementos en el combo // cboList.AddItem(clsValueDefinitionListItem.IntNull, "<Seleccione un elemento>"); // foreach (clsValueDefinitionListItem objListItem in objColListItems) // cboList.AddItem(objListItem.ID, objListItem.Description); // Selecciona el elemento cboList.SelectedID = (int)intValue; // Devuelve el combo return(cboList); }
/// <summary> /// Crea un control de lista /// </summary> private Control CreateControlList(string strValue) { Combos.ComboBoxExtended cboList = new Combos.ComboBoxExtended(); int intValue = 0; // Obtiene el valor if (!int.TryParse(strValue, out intValue)) intValue = 0; //// Carga los elementos de la lista // objColListItems.LoadByIDValue(objValue.ID); //// Asigna las propiedades // if (ModuleValueDefinition.IsRequired) // cboList.BackColor = Color.FromArgb(255, 255, 192); //// Muestra los elementos en el combo // cboList.AddItem(clsValueDefinitionListItem.IntNull, "<Seleccione un elemento>"); // foreach (clsValueDefinitionListItem objListItem in objColListItems) // cboList.AddItem(objListItem.ID, objListItem.Description); // Selecciona el elemento cboList.SelectedID = (int) intValue; // Devuelve el combo return cboList; }