As seen in the example on the website you've linked to, the RenderValueAs
method takes a lambda expression where the parameter represents the current model for the row.
I tried html object attributes as the fourth parameter of actionlink but I was getting a red swiggly for some reason.
Usually Razor Intellisense and syntax highlighting in Visual Studio is very buggy. Never trust it. The fact that you are getting red squiggles in a Razor page doesn't mean that you have an error in your syntax. In most cases it means that it is the syntax highlighter that simply doesn't understand the syntax. The only reliable thing is to run your application and see if it works.
So with this in mind you may try:
columns
.Add(m => m.PersonID)
.Encoded(false)
.Sanitized(false)
.SetWidth(30)
.RenderValueAs(m =>
@<b>
@Html.ActionLink(
linkText: "Edit person details",
actionName: "EditPerson",
controllerName: "Index", // <-- Huh, Index looks like an action name, double check that
routeValues: new { id = m.PersonID },
htmlAttributes: null
)
</b>
);
Notice how I have used explicit parameter names to make the code more readable and avoid any ambiguities with the gazzillions of overloads of the ActionLink method that the designers of the framework provided us.