This is a migrated thread and some comments may be shown as answers.

RadGrid Not Functioning After PostBack

3 Answers 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 25 Jul 2012, 02:46 PM
I have been looking around but have not found anyone with my same situation. I am using a control in an edit template inside a radgrid. I have a RadComboBox that on selection populates a panel with custom controls based on the combobox selection. After this or any other post back button is used the grid no longer posts back or functions. This also includes the other text boxes inside that same control. I was thinking this might have something to do with the viewstate but changing that around has no fixed the problem. This may just be something quick that I am missing. Any help would be much appreciated.

<asp:Content ID="conMain" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
        <script type="text/javascript">
            function openUserAdmin() {
                var oManager = window.radopen("User.aspx", null)
                oManager = $telerik.toWindow(oManager); // intellisense
                oManager.setSize(520, 600); //Width, Height
                oManager.center(); //Centers on Screen
                oManager.set_visibleStatusbar(false); //Bottom Status Hidden
                oManager.set_modal(true); //Makes window Modal
                oManager.set_reloadOnShow(true); //Reloads the page everytime its shown
                oManager.set_destroyOnClose(true); // destroys the window on close
                oManager.SetActive(); // Sets window as active element
                return false;
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock2">
        <script type="text/javascript">
            function openBusinessSegment() {
                var oManager = window.radopen("BusinessSegment.aspx", null)
                oManager = $telerik.toWindow(oManager); // intellisense
                oManager.add_close(gridInstallationRebind); // Rebinds the grid on close
                oManager.setSize(520, 600); //Width, Height
                oManager.center(); //Centers on Screen
                oManager.set_visibleStatusbar(false); //Bottom Status Hidden
                oManager.set_modal(true);
                oManager.set_reloadOnShow(true);
                oManager.set_destroyOnClose(true);
                oManager.SetActive();
                return false;
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadScriptBlock runat="server" ID="rsbGridRebind">
        <script type="text/javascript">
            function gridInstallationRebind() {
                var grd = $find("<%=RadGrid1.ClientID %>"); // Finds the grid
                grd = $telerik.toGrid(grd); // intellisense
                mtv = grd.get_masterTableView(); // finds the master table
                mtv.rebind(); // rebinds the data
            }
        </script>
    </telerik:RadScriptBlock>
    <%--Removable: For javscript telerik intellisense. Comment before running--%>
    <%--<telerik:radscriptmanager runat="server" id="rsm1" />--%>
    <%--End Comment Area--%>
    <telerik:RadWindowManager runat="server" ID="rwmPopUps" Animation="Fade" IconUrl="/Images/admin.png" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" Width="100%" ShowStatusBar="True" GridLines="None"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand"
            OnItemDataBound="RadGrid1_ItemDataBound" PageSize="15" EnableViewState="true" ViewStateMode="Inherit">
            <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
            <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ID" CommandItemSettings-AddNewRecordText="Add A New Installation"
                AllowSorting="True" ExpandCollapseColumn-ButtonType="SpriteButton" EditFormSettings-EditFormType="Template"
                CommandItemStyle-VerticalAlign="Middle" EnableViewState="true" ViewStateMode="Inherit">
                <CommandItemSettings AddNewRecordText="Add A New Installation"></CommandItemSettings>
                <CommandItemTemplate>
                    <div style="padding: 6px 2px 0px 2px;">
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnNewInstallation" Text="Add New Installation"
                                CommandName="InitInsert" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnBusinessSegment" Text="Business Segment Admin"
                                OnClientClicked="openBusinessSegment" AutoPostBack="false" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnUserAdmin" Text="User Admin" OnClientClicked="openUserAdmin" AutoPostBack="false" />
                        </div>
                        <div style="float: left; padding: 0px 2px 5px 2px;">
                            <telerik:RadButton runat="server" ID="btnRefresh" Text="Refresh" CommandName="RebindGrid" AutoPostBack="false" />
                        </div>
                    </div>
                </CommandItemTemplate>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="Edit">
                        <HeaderStyle Width="3%" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn HeaderText="Customer Name" UniqueName="Customer" SortExpression="Customer"
                        DataField="Customer">
                        <HeaderStyle Width="35%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Customer Location" UniqueName="Location" SortExpression="Location"
                        DataField="Location">
                        <HeaderStyle Width="25%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Installation Description" UniqueName="Description"
                        SortExpression="InstallationDescription" DataField="InstallationDescription">
                        <HeaderStyle Width="35%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                        ConfirmText="Delete Installation?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete">
                        <HeaderStyle Width="2%" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings EditFormType="Template" >
                    <EditColumn ButtonType="ImageButton" />
                    <FormTemplate>
                        <div>
                            <bw:LocationDetail ID="bwLocationDetail" runat="server" />
                        </div>
                    </FormTemplate>
                </EditFormSettings>
                <PagerStyle AlwaysVisible="True" />
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
    </div>
</asp:Content>

3 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 25 Jul 2012, 03:52 PM
I am also using login views. Could this be having an effect on the viewstate? The grid is also ajaxed. So any button that I press that ajax or calls javascript starts the problem. Anything in the edit template is not fully rendered so the information cannot even be edited.
0
James
Top achievements
Rank 1
answered on 25 Jul 2012, 08:04 PM
I have narrowed it down to the LoginView. I am guessing that it has something to do with how ajax callbacks function with login views. Do I need to change the location of my AjaxManager? Any information on how to correct thing problem would be great.
0
James
Top achievements
Rank 1
answered on 25 Jul 2012, 08:50 PM
I fixed the problem by moving the RadAjaxManager outside the loginview and then using the loginview as the initiator and the control to be updated. That solved my problem.
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or