We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Create simple grid and.....nothing output

Thread ID:

Created:

Updated:

Platform:

Replies:

88281 Jul 18,2009 01:12 PM Nov 12,2009 07:12 AM ASP.NET MVC (Classic) 5
loading
Tags: Grid
Eric Swann
Asked On July 18, 2009 01:12 PM

Hello, I have created a simple project to display a very basic flat grid, and nothing is output. I'm sure I'm missing something simple here...but can't figure it out. It doesn't throw an error, it just doesn't render anything. I have verified that my model contains data. In fact I'm just using a simply populated List.

The samples appear to work on my machine, and this follows the sample pretty exactly.

I've attached my sample project. Any ideas?

Thanks,
Eric



Gigabode.Web.UI.Admin_75fc6d4c.zip

Eric Swann
Replied On July 18, 2009 08:42 PM

Well, I did figure out the problem, but it's due to the documentation being incorrect. In the grid "getting started", it says to put the following in the view:

<%Html.Grid(
"MvcGridServerMode","GridModel" ,column =>{
column.Add(p => p.OrderID);
column.Add(p => p.EmployeeID);
column.Add(p => p.CustomerID);
column.Add(P => P.ShipCountry);
column.Add(p => p.OrderDate);
}); %>

For me, this did not work, I had to add the "=" sign to force output to the response:

<%= Html.Grid(
"MvcGridServerMode","GridModel" ,column =>{
column.Add(p => p.OrderID);
column.Add(p => p.EmployeeID);
...

Muthukumar L [Syncfusion]
Replied On July 20, 2009 01:14 AM

Hi Eric,



Thanks for evaluating Syncfusion products.



Your code looks correct after modifying two small errors,

1) MVC resource manager should be registered in the master page or the corresponding page.


Please place the following code inside the body tag of the site.master file.

<%Html.RegisterClientMvcResourceManager(); %>


It takes care of loading all script and CSS resources.


2) Equal to(“=”) symbol should be precceded the HTML helper object. Semicolon(“;”) should be removed at the end

This is the syntax for returning the string.


<%=Html.Grid

("MvcServ", "GridModel",

column =>

{

column.Add(role => role.Id).HeaderText("Role Id");

column.Add(role => role.RoleName).HeaderText("Role Name");

})

%>



Thanks for your patience.

Thanks,

Muthukumar.L

Scott Popovic
Replied On November 10, 2009 09:38 PM

Interesting one. My code was similar to the original post regarding syntax and it worked fine using v7.2 of the grid. I just upgraded to 7.4 and it stopped working. Making the susggested changes fixed the problem for me also.

Balaji M [Syncfusion]
Replied On November 12, 2009 12:43 AM

Hi Scott,

Thank you for your interest in Syncfusion product.

Our Essential Grid have been revamped to provide an enhanced support to extensive client side functionality. The functionalities are same like earlier versions, but the some properties are removed and Changed from Grid.

We would also suggest you to refer the below documentation link for more details.

http://help.syncfusion.com/ug_74/GridMVC/defaultMVC.html

Please let us know if the reported issue is resolved at your end.

Regards,
M. Balaji.

Balaji M [Syncfusion]
Replied On November 12, 2009 07:12 AM

Hi Scott,

Our Essential Grid have been revamped to provide an enhanced support to extensive client side functionality.The reported issue raised because of earlier RegisterClientMvcResourceManager . Our current [7.403.0.20] grid uses new MvcStaticResourceManager to register the css and scripts required to display and add functionality to the controls.


Add the Resource Manager to the Site.Master page under the tag as follows.


.....

<%=Html.RegisterStaticResources() %>



Please refer sample from the below location.

http://files.syncfusion.com/support/grid_mvc/Incidents/v7.4.0.20/F91281/MVC_GridSample.zip

Please let us know if the reported issue is resolved at your end.

Regards,
M. Balaji.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;