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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_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
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you can always use:

Epicor.Mfg.UI.FrameWork.EpiTreeViewPanel ep = (Epicor.Mfg.UI.FrameWork.EpiTreeViewPanel)csm.GetNativeControlReference("be35adba-2578-4a0e-9d37-4d1ba184c12e");
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.