Note that instead of using template you could use the inbuilt telerik custom command :
columns.Command(c => c.Custom("Edit").ButtonType(GridButtonType.Text).Action("Edit","Tracking").Text("Edit").SendDataKeys(true));
this command is "datakeys free" (you don't need to know the name of the Id key.
the only thing to do in your grid is to add :
.DataKeys(c => c.Add(d => d.Id).RouteKey("Id")) (change the Id name is necessary)
so you can create a extender like this :
public static GridActionColumnBuilder Edit<T>(this GridColumnFactory<T> builder)
where T : class
{
return builder.Command(c => c.Custom("Edit").ButtonType(GridButtonType.Text).Action("Edit", "Edit").Text("Edit").SendDataKeys(true));
}
public static GridActionColumnBuilder Delete<T>(this GridColumnFactory<T> builder)
where T : class
{
return builder.Command(c => c.Custom("Delete").ButtonType(GridButtonType.Text).Action("Delete", "Delete").Text("Delete").SendDataKeys(true));
}
@{ Html.Telerik()
.Grid(Model)
.DataKeys(c => c.Add(d => d.Id).RouteKey("Id"))
.Name("Grid")
.Columns(columns => {
columns.Bound(o => o.Name);
columns.Edit();
columns.Delete();
})
.Render();
}
But in all the case it's more efficient to use internal Edit/Delete command with the inbuilt databinding.