Exemplo n.º 1
0
        public void Execute(ComboBox comboBox, EntityBaseCollection dataSource, EntityPersistence entityTarget, string propertyName)
        {
            comboBox.DataSource = dataSource;

            comboBox.DisplayMember = "Value";
            comboBox.ValueMember   = "Key";

            object value = EntityReflection.Instance.GetValueProperty(entityTarget, propertyName);

            if (value != null && !string.IsNullOrEmpty(value.ToString()))
            {
                comboBox.SelectedValue = value;
            }

            Execute(comboBox, "SelectedValue", entityTarget, propertyName);
        }
Exemplo n.º 2
0
 public void Execute(ComboBox comboBox, EntityBaseCollection dataSource)
 {
     Execute(comboBox, dataSource, null, null);
 }