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

LVL 3
Trygve ThayerIT DirectorAsked:
Who is Participating?
 
Ryan ChongCommented:
you can always use:

Epicor.Mfg.UI.FrameWork.EpiTreeViewPanel ep = (Epicor.Mfg.UI.FrameWork.EpiTreeViewPanel)csm.GetNativeControlReference("be35adba-2578-4a0e-9d37-4d1ba184c12e");
0
 
_agx_Commented:
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.
0
 
Trygve ThayerIT DirectorAuthor Commented:
That Worked.  Got some more to do but got over the hump.  Thanks a bunch !!!
0
 
Trygve ThayerIT DirectorAuthor Commented:
The solution provided worked as expected.  Thank goodness for all these experts !!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.