Disable a form control when data is cleared

I am trying to find out how to make a custom control on a form become disabled/invisible when the form data is cleared using the Clear button from the toolbar.

I have add an epiShape to our Receipt Entry form to indicate a blanket PO. When I clear the data to enter a new PO to receive, I want that shape to be disabled/invisible until the PO data is loaded into the form.

Any thoughts?

not sure how finely you are controlling it beyond just being visible, there are color properties as well. You may already know the answers to that. Try using the Form Event Wizard for EpicViewNotification on the data view that you want to control this function. It would look something like the following;

	private void edvMyView_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))
			{
                myShape.Visible = true;
			}
            Else
            {
                myShape.Visible = false;
            }
		}
	}
1 Like

Rob -

Thanks. Works like a champ.