How to tie a BAQ to EpiMonthViewSingle

I have a BAQ that returns data from the Labor Detail table with employee and date information. I have it on a dashboard, but I would like to display the employee name on the calendar based on the date in the labor detail record. I build a dashboard for the BAQ, hid all of the fields, added a tracker, then went into customization mode and added the EpiMonthViewSingle onto the tracker. I then tried to tie the EpiMonthViewSingle to the view within the dashboard, but nothing comes into the calendar. I can’t seem to find documentation on how to tie the calendar into the view and how to specify what data to display.

Does anyone know how to show data in the EpiMonthViewSingle tool? Is there another way to show the data in a calendar format?

Have you already seen this topic…

I did see it but I didn’t see a way to bind it to a BAQ. I am not very savvy on Infragistics and how to link it to a BAQ. The code in the article (at least what I looked at) was not Epicor-specific.

I finally had some time to play with this. I found that you could loop through the EpiView to get the data from the grid into the calendar. Here is the code that shows what I did.

// Custom code for MainController
// Created: 12/22/2022 12:45:08 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	private EpiDataView edvV_ASI_POT_Requests_1View;
	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **
	EpiMonthViewSingle myCalendar;
	EpiUltraGrid myList;

	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		this.edvV_ASI_POT_Requests_1View = ((EpiDataView)(this.oTrans.EpiDataViews["V_ASI_POT_Requests_1View"]));
		this.edvV_ASI_POT_Requests_1View.EpiViewNotification += new EpiViewNotification(this.edvV_ASI_POT_Requests_1View_EpiViewNotification);
		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
		myCalendar = (EpiMonthViewSingle)csm.GetNativeControlReference("74afc345-800e-45f9-af42-4d5808c3e481");
		myList = (EpiUltraGrid)csm.GetNativeControlReference("7b959ecd-b252-4ad0-b0de-762e85410c52");
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		this.edvV_ASI_POT_Requests_1View.EpiViewNotification -= new EpiViewNotification(this.edvV_ASI_POT_Requests_1View_EpiViewNotification);
		this.edvV_ASI_POT_Requests_1View = null;
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
	}

	private void edvV_ASI_POT_Requests_1View_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
	{
		// ** Argument Properties and Uses **
		// view.dataView[args.Row]["FieldName"]
		// args.Row, args.Column, args.Sender, args.NotifyType
		// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
		
		if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
		{
			if ((args.Row > -1))
			{
				for( int i=0; i < view.dataView.Count;i++)	
				{
					Appointment app;
					app = myCalendar.CalendarInfo.Appointments.Add((DateTime)myList.Rows[i].Cells["Calculated_StartDateTime"].Value, myList.Rows[i].Cells["Calculated_Subject"].Value.ToString());
					app.AllDayEvent = true;
			
				}
			}
		}
	}
}