Link to home
Start Free TrialLog in
Avatar of Trygve Thayer
Trygve ThayerFlag for United States of America

asked on

C# Variable not working

I have some code that I can not seem to get working.  I think I am close but don't know the correct syntax.  Here is the error I am getting.

Compiling Custom Code ...
----------errors------------
 Error: CS0246 - line 222 (3013) - The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)
 ** Compile Failed. **


private void edvPREmployee_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.AddRow))
		{
			if ((args.Row > -1))
			{
			var ep = (Epicor.Mfg.UI.FrameWork.EpiTreeViewPanel)csm.GetNativeControlReference("be35adba-2578-4a0e-9d37-4d1ba184c12e");
			ep.ExpandAll();

			}
		}
	}

Open in new window

Avatar of _agx_
_agx_
Flag of United States of America image

Just a guess but

1. Are you compiling for 3.5 or higher?
2. Positive that's the line throwing the error? Usually occurs when var is used on a field. That's not the case with your code.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Trygve Thayer

ASKER

That Worked.  Got some more to do but got over the hump.  Thanks a bunch !!!
The solution provided worked as expected.  Thank goodness for all these experts !!!