How to kick off rad window from grid template column

4 posts, 1 answers
  1. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 19 Aug 2011 Link to this post

    I have a modal window that I can get to work just fine from a button in the user control but how do I get the rad window to start up from a template column in a grid view inside that user control that looks something like this:

    <telerik:GridTemplateColumn HeaderText="" UniqueName="ConfirmNo" AllowFiltering = "false">
    <ItemTemplate>
    <asp:Button ID="btnConfirmNo" runat="server" Text="No" CommandArgument='<%# Eval("_DocumentID") %>'
                        CommandName="ConfirmNo" />
            <asp:Label ID="lblConfirmNo" runat="server" CssClass="formLabel"></asp:Label>
                         </ItemTemplate>
                      <HeaderStyle HorizontalAlign="Center" />
         <ItemStyle HorizontalAlign="Center" Width="5%" />
    </telerik:GridTemplateColumn>
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 23 Aug 2011 Link to this post

    Hello Charles,

    The approach would still be the same - call an already existing JavaScript function that will open the RadWIndow (either a standalone via $find("ID"),show(), or via radopen(url, name) from a RadWindowManager). This JavaScript call can be attached to the OnClientClick of a button (where you should cancel the postback via the return false; statement in the handler) or you can inject it from the server-side if you need some server-side functionality to determine the URL for example. You can find attached a simple example that shows the approach. I believe you may also find the following help article useful: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.


    Regards,
    Marin
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 23 Aug 2011 Link to this post

    Now that I got that working with

    function openRadWindow() {
              GetRadWindowManager().open(null, "RadWindow1");
          }

    The purpose of this window is for the user to input comments about a document and then submit them backing via a submit button. The one thing I am missing out of all this is how to pass a value to the radwindow. I need this value to be able to submit the comments back to SQL.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 25 Aug 2011 Link to this post

    Hello Charles,

    There are several ways to pass values to a RadWindow 
    1) via a JavaScript object that you can get in the loaded page again via JavaScript. More information on this approach is available in the documentation and in the online demos
    2) when calling a function from the window you can pass a parameter to it as well.
    3) you can construct a new URL and pass the information as a querystring. This facilitates the use of code-behind. How to do so is shown in this help article and this online demo.
    4) if you are actually using the ContentTemplate (since you do not pass an URL) the RadWindow's content is actually a part of the main page and it can freely access all its objects. This difference is shown in this online demo.

    As for passing a value from the RadWindow - this can be done via its closing parameter. This can be seen in the article and demo I linked in point 1) .

    I hope the above information will help you choose and implement the option that best fits your needs.


    Greetings,
    Marin
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top