Adding RadPivotGrid to an MVC project - Script controls may not be registered after PreRender

2 posts, 0 answers
  1. Esteban
    Esteban avatar
    2 posts
    Member since:
    Mar 2008

    Posted 30 Jul 2013 Link to this post

    I'm trying to add a RadPivotGrid to an MVC project.  I followed the pattern mentioned here for regular Grids:, but when I try to bind, I get this error: "Script controls may not be registered after PreRender".

    Is it possible to do this?  This is what my view looks like:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Report/Reports.Master" Inherits="System.Web.Mvc.ViewPage" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
            RadPivotGrid1.DataSource = ViewData["GridData"];
        <telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <br />
            <br />

            <telerik:RadPivotGrid AllowPaging="True" Width="800px" Height="400px"
                ID="RadPivotGrid1" runat="server" ColumnHeaderZoneText="ColumnHeaderZone">
                <ClientSettings EnableFieldsDragDrop="true">
                    <Scrolling AllowVerticalScroll="true"></Scrolling>
                    <telerik:PivotGridRowField DataField="Field1">
                    <telerik:PivotGridRowField DataField="Field2">
                    <telerik:PivotGridColumnField DataField="Field3">
                    <telerik:PivotGridSortExpression FieldName="Field1" SortOrder="Descending"></telerik:PivotGridSortExpression>



  2. Marin
    Marin avatar
    1057 posts

    Posted 02 Aug 2013 Link to this post


     Unfortunately the RadPivotGrid does not support this approach of databinding in the code with calling the DataBind() method. That's why it is not suitable for use in MVC projects, its databinding and event mechanism is not compatible with the MVC framework.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top