This is a migrated thread and some comments may be shown as answers.

[Solved] Query string issue

2 Answers 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Slava Fedorchuk
Top achievements
Rank 1
Slava Fedorchuk asked on 12 Mar 2010, 10:17 PM
Basically - when query string is not well-formatted this causes an exception on a page with the Grid:
http://localhost:9500/Index?Grid-page=1&

    Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: key


Line 69: Html.Telerik().Grid(Model.results)





Here is a "working" example:
http://demos.telerik.com/aspnet-mvc/grid?a

Another one:
http://demos.telerik.com/aspnet-mvc/grid?ajax=True&Grid-page=2&

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 15 Mar 2010, 02:14 PM
Hi Slava Fedorchuk,

Thank you for reporting this problem. To fix it open the GridUrlBuilder.cs file and locate the PrepareRouteValues method. Now change this code:

if (!result.ContainsKey(key))
{
  result[key] = grid.ViewContext.HttpContext.Request.QueryString[key];
}


to this

if (key != null  && !result.ContainsKey(key))
{
   result[key] = grid.ViewContext.HttpContext.Request.QueryString[key];
}


All the best,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Slava Fedorchuk
Top achievements
Rank 1
answered on 15 Mar 2010, 09:02 PM
Fixed!
Thanks a lot!
Tags
Grid
Asked by
Slava Fedorchuk
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Slava Fedorchuk
Top achievements
Rank 1
Share this question
or