DataGrid InLine Editing Issue

I'm having difficulty with implementing inline editing that I am hoping someone can help me with.
I am able to add new rows correctly, but if I try to edit a row it throws an "Object reference not set to an instance of an object" error. and I can't find the issue.

My HTML:

My C#:

Any Questions please feel free.

Hi @copemed,

What happens when you debug the application? What is null?

Apologies for the late reply.

I solved my problem.
I forgot to apply the context to the EditTemplate.
Now it works as intended.

Apologies for the inconvenience.