This question is locked. New answers and comments are not allowed.
Hello Telerik, I add condition key != null, couse Request.Param is NameValueCollection, where key can be null.
public static RouteValueDictionary GetGridRouteValues(this ControllerBase controller)
{
var routeValues = new RouteValueDictionary();
foreach (string key in controller.ControllerContext.HttpContext.Request.Params)
{
if (null != key)
{
if (key.EndsWith(GridUrlParameters.CurrentPage, StringComparison.OrdinalIgnoreCase) ||
key.EndsWith(GridUrlParameters.Filter, StringComparison.OrdinalIgnoreCase) ||
key.EndsWith(GridUrlParameters.OrderBy, StringComparison.OrdinalIgnoreCase) ||
key.EndsWith(GridUrlParameters.GroupBy, StringComparison.OrdinalIgnoreCase) ||
key.EndsWith(GridUrlParameters.PageSize, StringComparison.OrdinalIgnoreCase))
{
routeValues[key] = controller.ControllerContext.HttpContext.Request.Params[key];
}
}
}
return routeValues;
}