Populate results in RadWindow

4 posts, 0 answers
  1. Kurt Kluth
    Kurt Kluth avatar
    144 posts
    Member since:
    Oct 2009

    Posted 17 Oct 2013 Link to this post

    Have an application where a user will step through the wizard like process and when they are satisfied they can click a button to get the results.  I would like for results that will be loaded into a RadGrid to be loaded into the RadWindow.  I have used it where I would open up an external page but this will not load an external page.  How do I get the button to work?

    <telerik:RadButton ID="_btnUpdateResults" runat="server" Text="Update Results"></telerik:RadButton>


    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Modal="true" Behaviors="Close"
                                        width="500px" Height="325px" ReloadOnShow="True" Animation="None" VisibleStatusbar="false" >
        <Windows>
            <telerik:RadWindow ID="RadWinResults" runat="server"
                ReloadOnShow="true" ShowContentDuringLoad="false"
                Visible="false" Overlay="true" VisibleOnPageLoad="true" style="display: inline; overflow:hidden;">
                <ContentTemplate>
                    <telerik:RadGrid ID="_SearchResults" runat="server"
                        AllowPaging="True" CellSpacing="0"
                        GridLines="None" ShowGroupPanel="True"
                        AllowSorting="True" PageSize="25" Width="100%" Height="700px"
                        AllowFilteringByColumn="True">
                        <GroupingSettings CaseSensitive="False" />
                        <ExportSettings IgnorePaging="True" OpenInNewWindow="True"
                            ExportOnlyData="True" FileName="CUCustomSearch">
                            <Excel AutoFitImages="True" Format="ExcelML" />
                            <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
                                BorderStyle="Medium" BorderColor="#666666">
                            </Pdf>
                        </ExportSettings>
                        <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True"
                            ReorderColumnsOnClient="True">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        </ClientSettings>
                        <MasterTableView CommandItemDisplay="Top" InsertItemDisplay="Bottom" TableLayout="Fixed">
                        <CommandItemSettings ShowAddNewRecordButton="False"
                            ShowExportToCsvButton="False" ShowExportToExcelButton="true" ShowRefreshButton="False" ShowExportToPdfButton="True" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
                                Visible="True">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
                                Visible="True">
                            </ExpandCollapseColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 21 Oct 2013 Link to this post

    Hello Kurt,

    If you do not want to use an external page you would need to make sure the contents of the RadWindow are included in the response from the server. At this point my best guess is that you are using AJAX and the _SearchResults grid is not updated.

    What I would advise is:
    1. move the RadWIndow out of the RadWIndowManager. This KB will explain an important reason for this: http://www.telerik.com/support/kb/aspnet-ajax/window/cannot-unregister-updatepanel-with-id-updatepanelid-since-it-was-not-registered-with-the-scriptmanager.aspx.
    2. make sure the grid is updated by adding an UpdatePanel in the RadWIndow and calling its server-side Update method when needed. This help article will explain how to use a RadWindow with AJAX: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html.
    3. open the RadWindow as shown in this sticky thread: http://www.telerik.com/community/forums/aspnet-ajax/window/opening-radwindow-from-the-server.aspx.


    Regards,
    Marin Bratanov
    Telerik
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kurt Kluth
    Kurt Kluth avatar
    144 posts
    Member since:
    Oct 2009

    Posted 22 Oct 2013 Link to this post

    Marin

    Thank you for your reply.  What I am gathering it would be best if it were loaded with an external page.  I am currently reworking the design of the page that it will make use of a Web User Control. 

    The challenge that I face is passing the information from the Parent page to the Child/Control (located in the window) page as the strings would be to long to pass through the QueryString. 

    Is there an example of the RadWindow where the Window gets information from the Parent?
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 23 Oct 2013 Link to this post

    Hi Kurt,

    You can pass data via JavaScript by using a custom field in the RadWindow client-side object: http://www.telerik.com/help/aspnet-ajax/window-programming-using-radwindow-as-dialog.html. The issue is that this happens on the client, so after getting the data in the dialog you would need to send it to the server. THere are many ways to do this and this blog post can help you with some ideas, from initiating postbacks, to more exotic requets: Different ways to make a request to the server in ASP.NET.

    The benefit from going with the JavaScript approach is that you do not need a postback on the main page if you can gather all needed data on the client.
    The downside is that you need a second post in the content page.

    If you need a postback in the main page to get the  data, however, you can consider a session or cache variable to hold your data, so it will be directly available in the code-behind of the content page.

    I hope these ideas show you what can be done and help you choose an approach suitable for your scenario and needs.


    Regards,
    Marin Bratanov
    Telerik
    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