Which version of the jqGrid you use? Could you post the test JSON data which you receive from the server (you can use Fiddler or Firebug to catch the data).
I would you not recommend to use datatype as function. If was
I use the version 3.8, but maybe my example found from internet is for the old version, I use just a normal web site in Visual Studio , and use json to pass the form data to server , search the data server , and produce the Json data with the function ToJson