radgrid load-on-demand not updating page

5 posts, 0 answers
  1. Felipe
    Felipe avatar
    33 posts
    Member since:
    Dec 2010

    Posted 31 Dec 2010 Link to this post

    i have a hierarchical radgrid on a master/content page which uses load on demand to load detail tables...

    this functionality WAS WORKING and then i made quite a few ajax-related changes (added controls with ajax functionality, various troubleshooting changes, etc) which somewhere along the line took away this functionality.

    the detailtabledatabind event is called, and executes properly, however it looks like the page is just never updated with the detail table data.

    any help is appreciated!

    I have my code below


    master page markup:
    <head runat="server">
         
        <title></title>
        <style type="text/css">
     
            html
            {
                overflow:hidden;
            }
     
            html,
            body,
            form
            {
                margin:0;
                height:100%;
                background-color:#f8f8f8;
            }
            #gridAreaContent
            {   
                position: absolute;
                width: 100%;
            }       
        </style>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
     
    </head>
    <body>   
         
        <telerik:RadSkinManager ID="_radSkinMan" Runat="server" Skin="WebBlue">
        </telerik:RadSkinManager>
        <form id="form1" runat="server">
         
            <telerik:RadScriptManager ID="_radScriptMan" runat="server">
                <Scripts>
                    <%--Needed for JavaScript IntelliSense in VS2010--%>
                    <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="_radAjaxMan" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="false" />
             
             
            <telerik:RadAjaxLoadingPanel
                ID="RadAjaxLoadingPanel1"
                runat="server"
                BackColor="White"
                Transparency="50"
                ScrollBars="None"
                Height="100%" />
     
             
     
        <telerik:RadSplitter ID="mainSplitter" runat="server" Height="100%" Width="100%" Orientation="Horizontal" >
            <telerik:RadPane ID="RadPane1" runat="server" CssClass="ApplyOverflow" Width="100%" Height="100px" Scrolling="None">
                <div style="width:100%;">
                    <telerik:RadMenu ID="_mainMenu" runat="server" Width="100%" style="position:absolute; border-width: 0px;">
                    </telerik:RadMenu>
                </div>
                 
                <div style="width:100%;">
                    <div style="width:300px; margin-top:20px; float:right;">
                        <asp:ContentPlaceHolder ID="loginArea" runat="server" />
                    </div>
                    <asp:ContentPlaceHolder ID="SearchArea" runat="server" />
                </div>
                 
            </telerik:RadPane >
            <telerik:RadPane ID="RadPane2" runat="server" Width="100%" Height="100%" Scrolling="None" >
                <telerik:RadSplitter ID="RadSplitter2" runat="server" Height="100%" Width="100%" Orientation="Vertical" >
                    <telerik:RadPane ID="RadPane3" runat="server" Height="100%" Scrolling="None">
                        <asp:ContentPlaceHolder ID="gridAreaContent" runat="server" />
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="Radsplitbar1" runat="server" CollapseMode="Backward" EnableResize="false"/>
                    <telerik:RadPane ID="RadPane4" runat="server" Height="100%"  Width="320px" Scrolling="None">
                        <asp:ContentPlaceHolder ID="navPanel" runat="server" />
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
     
        </telerik:RadSplitter>
         
        </form>
    </body>
    </html>

    relevant content markup:
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        <style type="text/css">
            #<%= _GridPanelClientID %>
            {
                margin:0;
                height:800px;
            }
     
            #_Grid_GridData 
            
               overflow-x:hidden !important; 
            }
             
            /*.bigModuleBottom td{padding:0}
            div.RadToolBar_Vista { float: none !important; }
            div.RadToolBar_Vista .rtbOuter { border: 0; } */
     
            div.RadToolBar .rtbUL {
                width: 100%;
            }
            div.SeparatedButtons .rtbItem {
                float: left;
            }          
      
            div.SeparatedButtons .rightAlignedWrapper {
                text-align:center;
                float: right !important;
            }
        </style>
        <telerik:RadCodeBlock id="RadCodeBlock1" runat="server">   
            <script type="text/javascript">
     
                function onToolBarClientButtonClicking(sender, args) {
     
                function GetSelectedCSCPIDs()
                {
                    var selectedRows = $find("<%=_Grid.MasterTableView.ClientID %>").get_selectedItems();
                    var retVal = "";
                    for (var i = 0; i < selectedRows.length; i++)
                    {
                        var val = selectedRows[i].getDataKeyValue("id");
                        retVal += val + ",";
                    }
                    retVal = retVal.slice(0, retVal.length - 1);
                    return retVal;
                }
                function RecordSelected(index, e) {
                    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("declineChartRefresh;" + GetSelectedCSCPIDs());
                }
                function PopulateGridContextMenu()
                function RowContextMenu(sender, eventArgs) {
                function PopulateMenu(menu, row)
                function ClientGridMenuHidden(menu) {
            </script>
        </telerik:RadCodeBlock>
     
    </asp:Content>
     
     
     
     
    <asp:Content ID="Content2" ContentPlaceHolderID="gridAreaContent" runat="server">
        <telerik:RadAjaxManagerProxy ID="_radAjaxProxy" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="_GridContextMenu">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="_GridContextMenu" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_searchButton" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel5" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_navMarketListingsPanel" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_navMarketListingsPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_navNewsPanel" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_navNewsPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_navMAPanel" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_navMAPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_Grid" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_navDeclineCurvePanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="_radAjaxMan" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_navDeclineCurvePanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
     
        <input type="hidden" id="_GridSelected" name="_GridSelected" />
        <input type="hidden" id="_GridLastSelected" name="_GridLastSelected" />
        <input type="hidden" id="_GridCSCPIDsSelected" name="_GridCSCPIDsSelected" />
        <input type="hidden" id="currentQueryString" name="currentQueryString" />
     
        <telerik:RadContextMenu ID="_GridContextMenu"
                                runat="server"
                                OnItemClick="_GridContextMenu_ItemClick"
                                EnableRoundedCorners="true"
                                EnableShadows="true"
                                OnClientShowing="PopulateGridContextMenu"
                                OnClientHidden="ClientGridMenuHidden" >
            <Targets>
                <telerik:ContextMenuControlTarget ControlID="_Grid" />
            </Targets>
        </telerik:RadContextMenu>
     
     
        <telerik:RadAjaxPanel ID="RadAjaxPanel5" runat="server">
            <telerik:RadGrid ID="_Grid"
                             runat="server"
                             Width="100%"
                             Height="100%"
                             style="border:0;"
                             AutoGenerateColumns="False"
                             GridLines="None" >
                <MasterTableView CommandItemDisplay="Top">
                    <CommandItemTemplate>
                    </CommandItemTemplate>
                </MasterTableView>
                <ClientSettings>
                    <ClientEvents OnRowSelected="RecordSelected"
                                  OnRowDeselected="RecordSelected"
                                  OnRowContextMenu="RowContextMenu"></ClientEvents>
                </ClientSettings>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </asp:Content>

    relevant code-behind:
    protected void Page_Load(object sender, EventArgs e)
    {
        _Grid.DetailTableDataBind += new GridDetailTableDataBindEventHandler(_Grid_DetailTableDataBind);
        _Grid.NeedDataSource +=new GridNeedDataSourceEventHandler(_Grid_NeedDataSource);
        _Grid.SortCommand +=new GridSortCommandEventHandler(_Grid_SortCommand);
        _Grid.ItemDataBound +=new GridItemEventHandler(_Grid_ItemDataBound);
        _Grid.SelectedIndexChanged += new EventHandler(_Grid_SelectedIndexChanged);
     
        RadAjaxManager _radAjaxMan = RadAjaxManager.GetCurrent(Page);
     
        _radAjaxMan.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(_radAjaxMan_AjaxRequest);
        _radAjaxMan.AjaxSettings.AddAjaxSetting(_Grid, _navDeclineCurvePanel, (RadAjaxLoadingPanel)this.Master.FindControl("RadAjaxLoadingPanel1"));
        RadAjaxManager.GetCurrent(Page).AjaxSettingCreated += new RadAjaxControl.AjaxSettingCreatedDelegate(contentpagecs_aspx_AjaxSettingCreated);
        _radAjaxProxy.AjaxSettings.AddAjaxSetting(_Grid, _Grid);
        //_radAjaxProxy.AjaxSettings.AddAjaxSetting(RadMenu1, RadMenu1);
    }
     
        void _Grid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
    {
        e.Canceled = true;
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
        switch (e.DetailTableView.Name)
        {
            case "WP":
                {
                    string cscpID = dataItem.GetDataKeyValue("id").ToString();
                    e.DetailTableView.DataSource = GetDataTable(GetWellProductionFromCSCPID(cscpID));
                    break;
                }
            case "MWP":
                {
                    string WellID = dataItem.GetDataKeyValue("WellID").ToString();
                    e.DetailTableView.DataSource = GetDataTable(GetMonthlyProduction(WellID));
                    break;
                }
        }
    }


  2. Felipe
    Felipe avatar
    33 posts
    Member since:
    Dec 2010

    Posted 03 Jan 2011 Link to this post

    anyone have any ideas?  i have tried everything i can think of....

    please help!  I need this to work for a demo this week!
  3. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 06 Jan 2011 Link to this post

    Hello Leland,

    Could you please try adding the ajax setting which updates the RadGrid by himself and let me know if the issues still exists:
    <telerik:RadAjaxManagerProxy ID="_radAjaxProxy" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID=" _Grid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
    ....

    Looking forward for your reply.

    Regards,
    Radoslav
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  4. Felipe
    Felipe avatar
    33 posts
    Member since:
    Dec 2010

    Posted 07 Jan 2011 Link to this post

    Hello radislav,

    the ajaxsetting for _grid -> _grid is already there.  at the time of the post, it was being added in the page_load of the code-behind...  however now I have changed it and put it in the markup, however the behavior is still the same.

    any other ideas?  thanks
  5. Felipe
    Felipe avatar
    33 posts
    Member since:
    Dec 2010

    Posted 07 Jan 2011 Link to this post

    argh!  i figured it out!

    turns out... all my ajax settings were fine, and were not the problem.

    I had a _Grid_ItemDataBound event handler which was making a reference to a field in the child table which wasnt there, and apparently it was just breaking the execution, rather than returning the error!

    thanks for all your help anyway guys!
Back to Top