This is a migrated thread and some comments may be shown as answers.
Razor View Engine - Telerik Grid not rendered correctly
6 Answers 338 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan Søndergaard
Top achievements
Rank 1
Dan Søndergaard asked on 28 Jul 2010, 12:23 PM
We're trying out the new Razor view engine with the Telerik MVC Grid. However, when rendering the view, the grid is automatically placed on top of the page, no matter where in the markup it is placed.

<h2>Title</h2>

@Html.Telerik().Grid(Model).Name("Grid").Columns(cols =>
                {
                 cols.Bound(r => r.Column1);
                     cols.Bound(r => r.Column2);
                })

Also see attached file.

We hope you can provide a workaround or an update for the Telerik components.

Thanks in advance.

6 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Jul 2010, 05:11 PM
Hi Dan S√łndergaard,

I have created a simple test project which implements the required functionality. Everything works on my end.
Check it and let us know what your findings are.

Kind regards,
Georgi Krustev
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
Dan Søndergaard
Top achievements
Rank 1
answered on 29 Jul 2010, 07:51 AM
Thanks a lot.

Seems like it works perfectly :) 

We probably just have to go back an review our code.

/Dan
0
andy
Top achievements
Rank 1
answered on 02 Dec 2010, 02:34 AM
Actually it does not. The razor view does not render. Here is the build output when 'Build Views' option is set to true:

------ Rebuild All started: Project: MVC3TestsApp, Configuration: Debug Any CPU ------

MVC3TestsApp -> C:\Projects\Scratchpad\208223_mvc3testsapp\MVC3TestsApp\bin\MVC3TestsApp.dll

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(19): error CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(23): error CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.WebPages' (are you missing an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(24): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(25): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(34): error CS0012: The type 'System.Web.WebPages.WebPageBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.2.cs(19): error CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.2.cs(23): error CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.WebPages' (are you missing an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.2.cs(24): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.2.cs(25): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

ASPNETCOMPILER : error ASPPARSE: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\temp\a70da4e5\d3633782\App_Web_huuamcba.0.cs(19): error CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

0
King Wilder
Top achievements
Rank 2
answered on 08 Dec 2010, 08:55 PM
Unfortunately I'm also getting errors that System.Web.Helpers does not exist even though I have the assembly referenced.

I've attached a screenshot when I try to view the Razor view.
0
Rosen
Telerik team
answered on 09 Dec 2010, 08:01 AM
Hi,

The error you are getting is due to the fact that the sample is quite old and is not compatible with the latest Razor version. You may refer to this code library for an example of our component used with Razor view engine.

Regards,
Rosen
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
Chris
Top achievements
Rank 1
answered on 04 Jan 2011, 10:11 PM
I had the same problem, but your sample worked. After looking more closely, I saw that I used .Render(); and you did not. I took out the .Render() and it worked fine. However, with the .Render() it dumps the markup right under the body like the OP said. Is this a bug?
Tags
General Discussions
Asked by
Dan Søndergaard
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Dan Søndergaard
Top achievements
Rank 1
andy
Top achievements
Rank 1
King Wilder
Top achievements
Rank 2
Rosen
Telerik team
Chris
Top achievements
Rank 1
Share this question
or