I have Kendo MVC Grid in a view,
I would like to navigate from view to another view that holds Kendo Grid report.
@Html.ActionLink("Report", "GridList_Read", "Grid")
The above code is displaying not formatted plain text content.
How do call grid controller from a mvc view?
Thank you
7 Answers, 1 is accepted
Hello, Medhanie,
Generally, the call to the controller that you demonstrated seems to be correct. I'm not quite sure about the report that you aim to render. Could you please isolate the issue in a small, simplified runnable example, so we could examine the entire implementation and the issue itself.
Regards,
Nencho
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

Hi Nencho;
In my registration page (view) I have the following code
@Html.ActionLink("Report", "ActionName_Read", "ControllerName")
When I click the link I want to display the page where my Kendo Grid is
The controller for my kendo grid is as follows
public JsonResult ActionName_Read([DataSourceRequest]DataSourceRequest request)
{
....
// some data is loading here and working fine
return Json(result, JsonRequestBehavior.AllowGet);
}
When I click the link above, it displays pain data in my page.
What is the correct way of calling kendo grid controller and display its view from anywhere in my project?
Thank you
Hello, Medhanie,
You can place the Grid component in a separate Partial view and just use @Html.Partial("GridPartialViewName"). This way, you will load the content in the needed place, and once initiated, the Grid will call its read method.
Check this thread for more information:
Hope this would help.
Regards,
Nencho
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

Hi Nencho;
I am not looking to load my grid in the same page from where I am calling the grid.
Assume, I am in index.cshtml view, and my grid is in gridListView.cshtml view.
Being at index.cshtml view page I want to have a link, and when this link is clicked, I want to go to gridListView.cshtml view page.
I hope you understand my issue.
Let me know
thanks
Hello, Medhanie,
Thank you for the additional clarification.
The reason for the experienced issue is that the action link that you use is calling the action, responsible for the data binding of the Grid. That said, you need to load the controller and action that return the View, where the grid is contained. From there one, the Grid will automatically call its Read action to populate with data. Please check this forum thread, where the views navigation is described:
https://stackoverflow.com/questions/18313125/how-to-navigate-among-the-views-in-mvc
Hope this would help.
Regards,
Nencho
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.

Hi Nencho;
If you see in my post, I mentioned that I have included both controller name and action name that return the view where the grid is contained.
Yes, I am getting all the data in my browser, but my question was, how do I get it formatted.
The data is coming as plain text instead of in tabular format like the regular grid format.
Please let me as I need this in many section of my project
Thank you
Hello, Medhanie,
After another revision of the demonstrated implementation, it looks like the name of the View is the same as the read action in the grid. This may be the reason for the problematic behavior. If you want to open another view, and still reuse the current logic in your application, you can change the name of the method, in order to avoid the match of the view name.
Please give it a try and let me know the results.
Regards,
Nencho
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.