Delete action for mvc helper

Mar 30, 2012 at 3:37 AM

How come the delete action doesn't pass the property tagged with [JqGridColumnMapping(Key = true)] attribute to the URL action..  ? instead it passes "id"..

I'm using [Bind (Prefix="id")] behind my custom parameter so it works, but i'm just curious if this is by design .. ?

Mar 30, 2012 at 8:30 AM
Edited Mar 30, 2012 at 8:45 AM

The JqGridColumnMapping.Key informs jqGrid that it should use value of this filed instead of Id (or there is no Id field at all). But it doesn't change the name of parameter passed to the server. If you want to change this you need to use JqGridParametersNames. You can set it globaly in Global.asax liek this:

protected void Application_Start()

    JqGridRequest.ParameterNames = new JqGridParametersNames() { Id = "PropertyName" };

Or by using properties of helper and request.