Display data in grid

Topics: Customizing Orchard
Jul 18, 2011 at 11:18 AM

Hi,

 

How can i display table data into MVC?

Can i have sample code for how can i display table data to telerik grid?

 

lakmal

 

Jul 18, 2011 at 6:01 PM

Hi Lakmal,

I've been unable to get the Telerik MVC controls to work in Orchard and I believe some others have tried as well, but I haven't seen anyone post that they were successful.

I currently use the DataTables JQuery plugin when I need to use a grid. It integrates nicely with JQuery UI for theming as well.

Jul 22, 2011 at 10:32 PM

I'm getting closer on using the Telerik controls. I have the controls being rendered and styled properly...just having issues getting the javascript files registered properly so that client side functionality actually works.

Jul 25, 2011 at 8:37 AM

hi psenechal, can you pleas post some information on how you made the styles work?

thank you very much!!

Jul 27, 2011 at 9:08 PM

Hi Michael,

I was able to get the styles working by adding the telerik.common.min.css and the css for the style I wanted to use to the Styles folder in my module. Then I used the ResourceManifest.cs class in my project to point to them

builder.Add().DefineStyle("telerikcommon").SetUrl("telerik.common.min.css");
builder.Add().DefineStyle("telerikdefault").SetUrl("telerik.default.min.css");

and then registered them in the view as I would any other style...

@{ Style.Require("telerikcommon"); }
@{ Style.Require("telerikdefault"); }

Jul 27, 2011 at 9:22 PM

I also did a little troubleshooting with the guys over at Telerik and got some ideas from them. The first thing I did was remove the .Compressed() and .Combined() options from the ScriptRegistrar() tag they use. By doing this, you don't have to add the asset handler in the web.config...I figured let's keep this as simple as possible until it's working. The next thing I did was add .jQuery(false) to the ScriptRegistrar() tag which tells it not to add a script tag for their version of jQuery which is only 1.5.1.

What we've nailed it down to is that the ScriptRegistrar() tag just doesn't work in Orchard, but we have no idea why. What it should do is determine what Telerik controls are being used in your View, add the proper script tags for javascript and then initialize the controls using a $(document).ready(function (){}) tag. None of that is happening. You can manually add the scripts to the ScriptRegistrar() tag so that they render by doing this...

@Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(group => group.Add("telerik.common.min.js").Add("telerik.calendar.min.js").Add("telerik.datepicker.min.js"))

but that still doesn't initialize the controls with a $(document).ready(function (){}) tag.

Do any of the Orchard guys here have an idea on what might be preventing the ScriptRegistrar() tag from adding what it needs to in an Orchard project? I created a regular MVC3 project and everything works normally.

Coordinator
Jul 27, 2011 at 9:24 PM

Having no idea what Telerik is doing in that ScriptRegistrar thing, no.

Jul 27, 2011 at 9:32 PM

and their code is in a compiled .dll, so there's no way to get at it.

If the guys at Telerik can come up with any ideas on how to get their ScriptRegistrar thing to work, I'll post it back over here, but for right now, it's just not going to work unless you generate the controls in a standard MVC 3 application, view the source, then copy the control initialization code and paste it into your view...for every single control.

Coordinator
Jul 27, 2011 at 9:35 PM

I'm not very optimistic that two script managers can cohabitate on the same page. I think you would need a way to neutralize one and reproduce what it's doing on the other. When you are trying to eliminate duplicates, there can't be two of you.

Jul 27, 2011 at 9:53 PM

Here's something interesting while I was messing around with it...

I moved the

@using (Script.Foot())
{
    @Html.Telerik().ScriptRegistrar().jQuery(false)
}

to the end of the layout.cshtml file in my theme. The ScriptRegistrar() actually did what it's supposed to do and rendered the following

<script type="text/javascript" src="/OrchardLocal/Scripts/2011.2.712/telerik.common.min.js"></script>
<script type="text/javascript" src="/OrchardLocal/Scripts/2011.2.712/telerik.calendar.min.js"></script>
<script type="text/javascript" src="/OrchardLocal/Scripts/2011.2.712/telerik.datepicker.min.js"></script>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
jQuery('#DatePicker').tDatePicker({format:'M/d/yyyy', minValue:new Date(2011,6,27), maxValue:new Date(2100,0,1), selectedValue:new Date(2011,6,27)});});
//]]>
</script>

now it still doesn't work, but at least it's generating the proper code. I'm wondering if the //<![CDATA[ //]]> that are being rendered around the jQuery tags are preventing it from actually running

Coordinator
Jul 27, 2011 at 9:57 PM

the CDATA is actually the right way to do this in XHTML. It's fine.

Jul 27, 2011 at 10:07 PM

You're right...of course =) The problem was that I didn't add a web.config file to the scripts folder, so it couldn't read the .js files.

After I did that, guess what...IT WORKS!

I forgot to add some additional comments to the previous poster about getting the styles to work. What I posted before works for the style sheets, but you still need the images. So...copy the theme folder from the Telerik install directory that you want...I'm using the Default theme. I pasted the folder in my module under /Content/Images, so it now goes /Content/Images/Default/images.png

The style sheet that you added previously for your theme references the images as 'Default/image.png'. I just opened the style sheet and did a replace all

'Default/

for

'../Content/Images/Default/

Jul 27, 2011 at 10:26 PM

Just as an FYI, the only things we've added to Orchard.Web that you'll need to redo whenever you upgrade to a new version are

1. Added a reference to Telerik.Web.Mvc.dll

2. Added a <add namespace="Telerik.Web.Mvc.UI"/> to the Web.config file in the <system.web.webPages.razor> section

3. Added the Scripts folder from the Telerik MVC installation path to the Orchard.Web project (and copy over a Web.config file that allows read access to the Scripts folder)

Everything else is being done in the theme and in your module. Telerik's ScriptRegistrar() tag will only generate something if it sees a @Html.Telerik() tag in one of your views...so it won't generate anything for the rest of your Orchard website. By configuring the styles the way I outlined, you can control exactly which Views you want the style sheets to be included on and can also use different styles for different views this way.

Jul 30, 2011 at 10:21 PM

he psenechal you're a devilish guy :D great work.

please tell use after a few days, if it works completely as it should!!

 

greats michael

Jul 30, 2011 at 10:41 PM

btw if i move

@using (Script.Foot())
{
   @Html.Telerik().ScriptRegistrar().jQuery(false)
}

to the end of my layout file i get:

 

A circular reference was detected while serializing an object of type 'System.Reflection.RuntimeModule'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: A circular reference was detected while serializing an object of type 'System.Reflection.RuntimeModule'.

Source Error:

Line 174:@using (Script.Foot())
Line 175:{
Line 176:    @Html.Telerik().ScriptRegistrar().jQuery(false)
Line 177:}

any idea why it doesnt work for me?

 

thx

Jul 31, 2011 at 9:03 AM

psenechal the hint with ressourcebuilderwas like the big AHA EFFECT!!

NOW IT LOOKS PERFECT:) I Just have to get rid of the cicular references problematic

Jul 31, 2011 at 10:42 AM
Edited Jul 31, 2011 at 5:59 PM

we should make a complete description what has to be done to get it work!

So what i can say is that first important part is to add the ressources like you did via ResourceManifest.cs

otherwise it's not well displayd. For the second thing i always get the circular reference problem. i also tried several layouts. didn't help

Line 180:    @Html.Telerik().ScriptRegistrar().jQuery(false)

[InvalidOperationException: A circular reference was detected while serializing an object of type 'System.Reflection.RuntimeModule'.]
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1478
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +126
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1311
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +282
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeCustomObject(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +502
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1355
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +126
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValueInternal(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +1311
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +194
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +26
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +74
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) +6
   Telerik.Web.Mvc.UI.ClientSideObjectWriter.AppendCollection(String name, IEnumerable value) +141
   Telerik.Web.Mvc.UI.GridEditingSettings`1.SerializeTo(String key, IClientSideObjectWriter writer) +1700
   Telerik.Web.Mvc.UI.GridClientObjectSerializer`1.Serialize(IClientSideObjectWriter writer) +440
   Telerik.Web.Mvc.UI.Grid`1.WriteInitializationScript(TextWriter writer) +176
   Telerik.Web.Mvc.UI.ScriptRegistrar.WriteScriptStatements(TextWriter writer) +1285
   Telerik.Web.Mvc.UI.ScriptRegistrar.Write(TextWriter writer) +67
   Telerik.Web.Mvc.UI.ScriptRegistrar.ToHtmlString() +97
   Telerik.Web.Mvc.UI.ScriptRegistrarBuilder.ToHtmlString() +36
   Telerik.Web.Mvc.{Dynamic}.ScriptRegistrarBuilder.IHtmlString.ToHtmlString() +30
   System.Web.HttpUtility.HtmlEncode(Object value) +38
   System.Web.WebPages.WebPageBase.Write(Object value) +64
   ASP._Page_Themes_TheThemeMachine_Views_Layout_cshtml.Execute() in .... l:176
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +279
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +113
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model) +32
   Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in c:\temptrunk\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:133
   Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in c:\temptrunk\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:117
   Orchard.DisplayManagement.Descriptors.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in \ShapeAlterationBuilder.cs:55
   Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\temptrunk\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:173
   Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\temptrunk\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:82
   Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\temptrunk\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71
   Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in c:\temptrunk\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:38
   Orchard.DisplayManagement.Implementation.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in c:\temptrunk\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:27
   ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() +79
   ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) +58
   ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) +145
   Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in c:\temptrunk\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:63
   Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) in c:\temptrunk\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:90
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in c:\temptrunk\src\Orchard\Mvc\Routes\ShellRoute.cs:148
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862381
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Jul 31, 2011 at 6:20 PM

oh my research shows me that the problem is not with the grid anymore, it seems to be my codebehind ?!

Aug 5, 2011 at 7:14 PM

Hi Michael,

Sorry, I've been down with the flu for a few days. I believe the error you're receiving has to do with your object models and whatever Telerik control you're using to display them. I have found that when you have a model that references another model as one of it's data points...ie

    public class ReportOptionValueRecord
    {
        [ScaffoldColumn(true)]
        [HiddenInput(DisplayValue = false)]
        public virtual int Id { get; set; }
        [ScriptIgnore]
        public virtual ReportOptionRecord ReportOption { get; set; }
        [DisplayName("Value")]
        [Required]
        public virtual string OptionValueValue { get; set; }
        [DisplayName("Name")]
        [Required]
        public virtual string OptionValueName { get; set; }
    }
where you can see that ReportOption is a ReportOptionRecord object...you need to add a [ScriptIgnore] annotation to it. Otherwise the Telerik control attempts to resolve the object instead of simply using the Id for the field. I don't really know how to explain it properly, but this worked for me when attempting to Update or Delete an item in a grid.

Aug 15, 2011 at 11:15 AM
Edited Aug 15, 2011 at 11:16 AM

how can we call this :

 

@using (Script.Foot())
{
    @Html.Telerik().ScriptRegistrar().jQuery(false)
}


from our module, so that we dont have to add it at the end of the theme-layout?

if we could solve this task, the modules would be independant

im sure there is a way :)
Aug 15, 2011 at 7:22 PM

I couldn't get it to work from inside my module, but even getting it to work there wouldn't make it module independent. You still have to add the namespace to the Orchard.Web web.config and you have to add a reference to the Telerik dll in Orchard.Web. I figured adding a ScriptRegistrar to my theme wasn't too much more to do. I'd love to get it completely inside my module, but I couldn't get it to work that way. Maybe someone else can pick up from where I got it working and try to isolate all the code to the module.

Aug 17, 2011 at 11:03 PM
Edited Aug 17, 2011 at 11:05 PM

dont you think the reference and the namespace are just needed because of 

 @Html.Telerik().ScriptRegistrar().jQuery(false)

in the theme ?

thats what i think!!!

 

we just need to inject the footer from the module into the theme somehow. i bet on that