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;
			}
		}
		private void InitDargDropHelper()
		{
			if (_dragDropHelper != null || !PackageRecords.Any()) return;
			_dragDropHelper = new GridDragDropHelper(advBandedGridView, true, handledColumns: new[] { bandedGridColumnId });
			_dragDropHelper.AfterDrop += OnGridControlAfterDrop;
		}
		private void InitDargDropHelper()
		{
			if (_dragDropHelper != null || !_data.Programs.Any()) return;
			_dragDropHelper = new GridDragDropHelper(advBandedGridView, true, handledColumns: new[] { bandedGridColumnIndex, bandedGridColumnLogo });
			_dragDropHelper.AfterDrop += OnGridControlAfterDrop;
		}
Esempio n. 4
0
		public void UpdateGridData(bool rebuildColumns)
		{
			int focussedRow = advBandedGridViewSchedule.FocusedRowHandle;
			advBandedGridViewSchedule.BeginUpdate();

			gridControlSchedule.DataSource = null;
			gridControlSchedule.DataMember = String.Empty;

			bandedGridColumnDay.FieldName = ScheduleSection.ProgramDayDataColumnName;
			bandedGridColumnDaypart.FieldName = ScheduleSection.ProgramDaypartDataColumnName;
			bandedGridColumnCPP.FieldName = ScheduleSection.ProgramCPPDataColumnName;
			bandedGridColumnCPP.SummaryItem.FieldName = ScheduleSection.ProgramTotalCPPDataColumnName;
			bandedGridColumnGRP.FieldName = ScheduleSection.ProgramGRPDataColumnName;
			bandedGridColumnGRP.SummaryItem.FieldName = ScheduleSection.ProgramGRPDataColumnName;
			bandedGridColumnIndex.FieldName = ScheduleSection.ProgramIndexDataColumnName;
			bandedGridColumnLength.FieldName = ScheduleSection.ProgramLengthDataColumnName;
			bandedGridColumnLogoImage.FieldName = ScheduleSection.ProgramLogoImageDataColumnName;
			bandedGridColumnLogoSource.FieldName = ScheduleSection.ProgramLogoSourceDataColumnName;
			bandedGridColumnName.FieldName = ScheduleSection.ProgramNameDataColumnName;
			bandedGridColumnRate.FieldName = ScheduleSection.ProgramRateDataColumnName;
			bandedGridColumnRating.FieldName = ScheduleSection.ProgramRatingDataColumnName;
			bandedGridColumnStation.FieldName = ScheduleSection.ProgramStationDataColumnName;
			bandedGridColumnTime.FieldName = ScheduleSection.ProgramTimeDataColumnName;
			bandedGridColumnTotalSpots.FieldName = ScheduleSection.ProgramTotalSpotDataColumnName;
			bandedGridColumnTotalSpots.SummaryItem.FieldName = ScheduleSection.ProgramTotalSpotDataColumnName;
			bandedGridColumnCost.FieldName = ScheduleSection.ProgramCostDataColumnName;
			bandedGridColumnCost.SummaryItem.FieldName = ScheduleSection.ProgramCostDataColumnName;

			_sectionContainer.SectionData.GenerateDataSource();

			if (rebuildColumns)
				BuildSpotColumns();
			if (_sectionContainer.SectionData.Programs.Any())
			{
				pbNoPrograms.Visible = false;
				gridControlSchedule.Visible = true;
				gridControlSchedule.BringToFront();
				gridControlSchedule.DataSource = _sectionContainer.SectionData.DataSource;
			}
			else
			{
				gridControlSchedule.Visible = false;
				pbNoPrograms.Visible = true;
				pbNoPrograms.BringToFront();
			}
			advBandedGridViewSchedule.EndUpdate();
			if (_dragDropHelper == null && _sectionContainer.SectionData.Programs.Any())
			{
				_dragDropHelper = new GridDragDropHelper(advBandedGridViewSchedule, true, 40, handledColumns: new[] { bandedGridColumnIndex, bandedGridColumnLogoImage });
				_dragDropHelper.AfterDrop += OnGridControlAfterDrop;
			}
			if (focussedRow >= 0 && focussedRow < advBandedGridViewSchedule.RowCount)
				advBandedGridViewSchedule.FocusedRowHandle = focussedRow;
		}