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. Image for the cookie policy date
close icon

Create simple grid and.....nothing output

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

5 Replies

ES Eric Swann July 19, 2009 12:42 AM UTC

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);
...


ML Muthukumar L Syncfusion Team July 20, 2009 05:14 AM UTC

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


SP Scott Popovic November 11, 2009 02:38 AM UTC

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.


BM Balaji M Syncfusion Team November 12, 2009 05:43 AM UTC

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.


BM Balaji M Syncfusion Team November 12, 2009 12:12 PM UTC

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.

Loader.
Live Chat Icon For mobile
Up arrow icon