public void UpdateData(
			DigitalProductsContent content,
			IDigitalScheduleSettings scheduleSettings,
			Action onDataChanged)
		{
			Content = content;
			ScheduleSettings = scheduleSettings;
			_onDataChanged = onDataChanged;

			gridControl.DataSource = new BindingList<DigitalProduct>(Content.DigitalProducts);

			if (ListManager.Instance.ProductSources.All(productSource => String.IsNullOrEmpty(productSource.SubCategory)))
			{
				gridColumnCategory.RowCount = 2;
				gridColumnSubCategory.Visible = false;
			}

			if (ListManager.Instance.LockedMode)
			{
				gridColumnWidth.OptionsColumn.ReadOnly = true;
				gridColumnWidth.OptionsColumn.AllowEdit = false;
				gridColumnHeight.OptionsColumn.ReadOnly = true;
				gridColumnHeight.OptionsColumn.AllowEdit = false;
				repositoryItemComboBoxProductName.TextEditStyle = TextEditStyles.DisableTextEditor;
			}

			repositoryItemComboBoxRateType.Items.Clear();
			repositoryItemComboBoxRateType.Items.AddRange(ListManager.Instance.PricingStrategies);
			repositoryItemComboBoxLocation.Items.Clear();
			repositoryItemComboBoxLocation.Items.AddRange(ListManager.Instance.ColumnPositions);

			if (_dragDropHelper == null)
			{
				_dragDropHelper = new GridDragDropHelper(advBandedGridView, true, handledColumns: new[] { gridColumnPosition });
				_dragDropHelper.AfterDrop += DigitalProductsAfterDrop;
			}
		}
Example #2
0
        public void UpdateData(
            DigitalProductsContent content,
            IDigitalScheduleSettings scheduleSettings,
            Action onDataChanged)
        {
            Content          = content;
            ScheduleSettings = scheduleSettings;
            _onDataChanged   = onDataChanged;

            gridControl.DataSource = new BindingList <DigitalProduct>(Content.DigitalProducts);

            if (ListManager.Instance.ProductSources.All(productSource => String.IsNullOrEmpty(productSource.SubCategory)))
            {
                gridColumnCategory.RowCount   = 2;
                gridColumnSubCategory.Visible = false;
            }

            if (ListManager.Instance.LockedMode)
            {
                gridColumnWidth.OptionsColumn.ReadOnly          = true;
                gridColumnWidth.OptionsColumn.AllowEdit         = false;
                gridColumnHeight.OptionsColumn.ReadOnly         = true;
                gridColumnHeight.OptionsColumn.AllowEdit        = false;
                repositoryItemComboBoxProductName.TextEditStyle = TextEditStyles.DisableTextEditor;
            }

            repositoryItemComboBoxRateType.Items.Clear();
            repositoryItemComboBoxRateType.Items.AddRange(ListManager.Instance.PricingStrategies);
            repositoryItemComboBoxLocation.Items.Clear();
            repositoryItemComboBoxLocation.Items.AddRange(ListManager.Instance.ColumnPositions);

            if (_dragDropHelper == null)
            {
                _dragDropHelper            = new GridDragDropHelper(advBandedGridView, true, handledColumns: new[] { gridColumnPosition });
                _dragDropHelper.AfterDrop += DigitalProductsAfterDrop;
            }
        }