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

Custom radconfirm

10 Answers 136 Views
Window
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 22 May 2013, 11:12 AM
Hi,

How can I customize radconfirm? I need to add an asp label and an image in radconfirm?

10 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 22 May 2013, 11:34 AM
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.
0
Saravanan
Top achievements
Rank 1
answered on 22 May 2013, 01:15 PM
This is also fine. Thanks for your prompt and quick reply.
0
Saravanan
Top achievements
Rank 1
answered on 31 May 2013, 01:15 AM
Hi Shinu,
Is it possible to add a custom image to RadConfirm? I would like to replace the ? image with my own image?
0
Shinu
Top achievements
Rank 1
answered on 31 May 2013, 03:51 AM
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.
0
Saravanan
Top achievements
Rank 1
answered on 03 Jun 2013, 12:18 PM
Hi Shinu, My page contain few radwindows. I want to access the first radwindow. How can I get the first radwindow from the group?
0
Accepted
Shinu
Top achievements
Rank 1
answered on 03 Jun 2013, 12:50 PM
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.
0
Saravanan
Top achievements
Rank 1
answered on 05 Jun 2013, 08:17 AM
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.
0
Shinu
Top achievements
Rank 1
answered on 05 Jun 2013, 09:08 AM
Hi Saravanan,

Try overriding the default CSS as follows.

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

Thanks,
Shinu.
0
Saravanan
Top achievements
Rank 1
answered on 28 Jun 2013, 08:45 AM
Hi Shinu,

How can I place a radwindow to middle of the screen and set its size when opened using JS code?
0
Shinu
Top achievements
Rank 1
answered on 28 Jun 2013, 09:44 AM
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.
Tags
Window
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Saravanan
Top achievements
Rank 1
Share this question
or