The reason why you're seeing "System.Collections.Generic.List'1[System.String]"
is because this is what listOfStrings.ToString()
returns. Which is what is being called when you populate your route values by using the anonymous type new { ... }
.
You'll need to do something along the lines of
var routeValues = new RouteValueDictionary();
routeValues.Add("filePath", filePath);
for (int i = 0; i < searchTerms.Count(); i++)
{
var key = String.Format("searchTerms[{0}]", i);
routeValues.Add(key, searchTerms[i]);
}
// ...
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("MyGridAction", "MyController", routeValues))
// don't have a compiler with me so this may be the wrong overload
// ...
This means that each individual item has its own key so the model binder can play nicely with it.
For more information, read this blog post by Scott Hanselman.