Custom radconfirm

11 posts, 2 answers
  1. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 22 May 2013 Link to this post

    Hi,

    How can I customize radconfirm? I need to add an asp label and an image in radconfirm?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 May 2013 Link to this post

    Hi Saravanan,

    One suggestion is you can use the RadWindow as a RadConfirm. Please have a look at the following code I tried to display a confirm dialog on clicking a Delete RadButton.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Delete" OnClientClicking="showConfirmRadWindow"
        OnClick="RadButton1_Click">
    </telerik:RadButton>
    <telerik:RadWindow ID="confirmWindow" runat="server" VisibleTitlebar="true" VisibleStatusbar="false"
        Modal="true" Behaviors="None" Height="200px" Width="300px" Title="Confirm Delete">
        <ContentTemplate>
            <asp:Label runat="server" Text="My Label Text">
            </asp:Label>
            <br />
            <br />
            <asp:Image runat="server" ImageUrl="~/Images/aud.jpg" ImageAlign="Left" />
            <div style="padding-left: 30px; padding-top: 20px; width: 200px; float: left;">
                <asp:Label ID="lblConfirm" Font-Size="14px" Text="Are you sure you want to Delete?"
                    runat="server"></asp:Label>
                <br />
                <br />
                <telerik:RadButton ID="RadButtonYes" runat="server" Text="Yes" AutoPostBack="false"
                    OnClientClicked="confirmResult">
                </telerik:RadButton>
                <telerik:RadButton ID="RadButtonNo" runat="server" Text="No" AutoPostBack="false"
                    OnClientClicked="confirmResult">
                </telerik:RadButton>
            </div>
        </ContentTemplate>
    </telerik:RadWindow>

    JavaScript:
    <script type="text/javascript">
        function showConfirmRadWindow(sender, args) {
            $find("<%=confirmWindow.ClientID %>").show();
            $find("<%=RadButtonYes.ClientID %>").focus();
            args.set_cancel(true);
        }
        function confirmResult(sender, args) {
            var oWnd = $find("<%=confirmWindow.ClientID %>");
            oWnd.close();
            if (sender.get_text() == "Yes") {
                $find("<%=RadButton1.ClientID %>").click();
            }
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 22 May 2013 Link to this post

    This is also fine. Thanks for your prompt and quick reply.
  5. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 30 May 2013 Link to this post

    Hi Shinu,
    Is it possible to add a custom image to RadConfirm? I would like to replace the ? image with my own image?
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 May 2013 Link to this post

    Hi,

    Try overriding the default CSS as follows.

    CSS:
    <style type="text/css">
        .RadWindow .rwWindowContent .radconfirm
        {
            background-image: url("../Images/Image1.JPG") !important;
        }
    </style>

    Thanks,
    Shinu.
  7. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 03 Jun 2013 Link to this post

    Hi Shinu, My page contain few radwindows. I want to access the first radwindow. How can I get the first radwindow from the group?
  8. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Jun 2013 Link to this post

    Hi,

    I guess you are having the RadWindows inside a RadWindowManager. Please have a look at the following code to access the first RadWindow in the RadWindowManager.

    C#:
    //Get a reference to the first window in the list
    Telerik.Web.UI.RadWindow firstWindow = WindowManager.Windows[0];

    Thanks,
    Shinu.
  9. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 05 Jun 2013 Link to this post

    Thanks for your wonderful support. Yah, i am using radwindows inside windowmanager as your guess.

    I have another requirement. I need to change the background color of the radconfirm body. Please help with the CSS.
  10. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Jun 2013 Link to this post

    Hi Saravanan,

    Try overriding the default CSS as follows.

    CSS:
    <style type="text/css">
        .RadWindow .rwWindowContent
        {
            background-color:Beige !important;
        }
    </style>

    Thanks,
    Shinu.
  11. Saravanan
    Saravanan avatar
    26 posts
    Member since:
    Mar 2013

    Posted 28 Jun 2013 Link to this post

    Hi Shinu,

    How can I place a radwindow to middle of the screen and set its size when opened using JS code?
  12. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Jun 2013 Link to this post

    Hi Saravanan,

    Please try the following JavaScript.

    JavaScript:
    <script type="text/javascript">
        function openRadWindow() {
            var oWnd = var oWnd = radopen ("http://www.google.com", "RadWindow1");
            oWnd.setSize(315, 250);
            oWnd.Center();
        }
    </script>

    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017