Exemple #1
0
        /// <summary>
        /// Sets specified value to the control.
        /// </summary>
        /// <param name="descriptor">Descriptor of Workitem.</param>
        /// <param name="valueId">Value of the Workitem property.</param>
        protected virtual void SetSelection(WorkitemPropertyDescriptor descriptor, object valueId)
        {
            var dataSource = DataLayer.GetListPropertyValues(descriptor.Workitem.TypePrefix + descriptor.Attribute);

            foreach (var item in dataSource)
            {
                ListBox.Items.Add(item);
            }

            ListBox.SelectedItem = valueId;
        }
        protected override void SetSelection(WorkitemPropertyDescriptor descriptor, object propertyValues)
        {
            var propertyName = descriptor.Workitem.TypePrefix + descriptor.Attribute;

            foreach (var item in DataLayer.GetListPropertyValues(propertyName))
            {
                ListBox.Items.Add(item);
            }

            foreach (var valueId in (PropertyValues)propertyValues)
            {
                ListBox.SelectedItems.Add(valueId);
            }
        }