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

radalert custom icon

11 Answers 733 Views
Window
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 17 Aug 2009, 06:26 AM
Hi:

Can somebody share a way for having a radalert customized? I want to have a different icon for each case I use radalert, something like the vb 6.0 alert window.

The current radalert only has an "alert icon", but it doesnt have the option for parametrize the image icon for: information, all ok, warning, etc, etc

Thanks in advance.

11 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 17 Aug 2009, 07:27 PM
I looked around a bit and found the following links:
http://www.telerik.com/community/forums/aspnet-ajax/window/remove-radalert-icon.aspx
http://www.telerik.com/help/aspnet-ajax/appearance-css-classes-usage.html http://www.telerik.com/community/forums/aspnet-ajax/window/changing-radalert-icon.aspx
Basically it seems like you'll have to go in and change around some CSS in order to get this to work. In the first link someone has removed the icon - perhaps this can be used to define an icon as well?


0
iomega 55
Top achievements
Rank 1
answered on 18 Aug 2009, 04:56 AM
Thanks for reply.

Do you have a working sample with a change for the radalert icon?

I raise the radalert window on the client side.

The solutions you share show how to remove the icon, but not how(explicit) change the icon.

Thanks again.
0
Georgi Tunev
Telerik team
answered on 18 Aug 2009, 07:41 AM
Hi iomega 55,

Here is how to change the radalert icon with CSS:
div.rwDialogPopup 
{  
    background-image:url(Skins/Black/Common/loading.gif)  !important;  
}  



Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
iomega 55
Top achievements
Rank 1
answered on 19 Aug 2009, 01:40 AM
Thank you for help us.

One more request.

How can I do this clientside?

function fnShowRadAlert(typeIcon)
{
    switch (typeIcon)
    {
        case 0:
                   radalert   ->  with alert icon
                   break;
        case 1:
                   radalert   ->  with warning icon
                   break;
        case 2:
                   radalert   ->  with ok icon
                   break;
}

I mean, How can I change CSS dynamically?
0
DK
Top achievements
Rank 2
answered on 26 Aug 2009, 11:31 AM
popupElementpopupElement.className = popupElement.className + " icon2"; 

i am not getting this line?
if i write popupElement.className =  " icon2"; 
then the  whole popup gets destroyed the image i am using gets all over the popup and ok button is seen only as link button and go to the left side of  the window?
0
Georgi Tunev
Telerik team
answered on 26 Aug 2009, 12:05 PM
EDIT:
Hello DK

The correct line is:
popupElement.className = popupElement.className + " icon2";
There was a duplicated string in the code - I fixed it to avoid further problems.

/END EDIT


Hi iomega 55,

Yes, this is possible. Here is a small sample that shows the basic approach - you can extend it further to fit your requirements.

<head runat="server"
    <title></title
    <style type="text/css"
        .icon1 div.rwDialogPopup 
        { 
            background-image: url(Skins/Black/Common/loading.gif) !important; 
        } 
        .icon2 div.rwDialogPopup 
        { 
            background-image: url(Skins/Hay/Common/loading.gif) !important; 
        } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    </telerik:RadWindowManager> 
 
    <script type="text/javascript"
        function callAlert() 
        { 
            var oWnd = radalert('main text to display', 340, 110, 'new title'); 
            var popupElement = oWnd.get_popupElement(); 
            popupElement.className = popupElement.className + " icon2"; 
        } 
    </script> 
 
    <button onclick="callAlert(); return false;"
        show radalert</button> 
    </form> 


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
DK
Top achievements
Rank 2
answered on 26 Aug 2009, 12:21 PM
but still i mgetting the default image of the alert  and not which i want to display ?
please help me in this regard

i have the following function
<style type"text/css">
.icon Div .rwDialogPopup
{
background-image:url(Images/error.jpg) !important;
}
</style>
var divStart="<Div class='ABC'>";
var divEnd="</Div>";

function TOAAlert(msg)
{
var oWnd = radalert(divStart+msg+divEnd,100,100,"TOA_Alert");
var popupElement=oWnd.get_popupElement();
popupElement.className=popupElement.className+"icon";
0
Schlurk
Top achievements
Rank 2
answered on 26 Aug 2009, 05:35 PM
You have a few little mistakes like a missing "=" etc., but just copy + paste this code.

Head section:
    <style type="text/css" > 
        .icon div.rwDialogPopup  
        {  
            background-image: url(Images/error.jpg) !important;  
        }  
    </style> 

And then this in the body:
    <script type="text/javascript"
        var divStart = "<Div class='ABC'>"
        var divEnd = "</Div>"
        function TOAAlert(msg)  
        {  
            var oWnd = radalert(divStart + msg + divEnd, 100, 100, 'TOA_Alert');  
            var popupElement = oWnd.get_popupElement();  
            popupElement.className = popupElement.className + " icon"
        } 
    </script>  

Tested and it worked fine for me.
0
DK
Top achievements
Rank 2
answered on 27 Aug 2009, 05:00 AM
thanks Schlurk
Now its working fine for me.
thanks a lot.
0
Usman Khalid
Top achievements
Rank 1
answered on 25 Jan 2010, 07:35 AM
Hello Everybody,
I want to ask if someone can provide me some help for setting my customized icon for File Explorer's folders and contents.

Regards
Usman Khaid
0
Schlurk
Top achievements
Rank 2
answered on 25 Jan 2010, 02:33 PM
There is a forum post by a Telerik team member, found here, which you can look into for having your own custom icons. Essentially you  have a sprite sheet which you would have to modify (or replace) in order to get your own custom icons up and running.
Tags
Window
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
iomega 55
Top achievements
Rank 1
Georgi Tunev
Telerik team
DK
Top achievements
Rank 2
Usman Khalid
Top achievements
Rank 1
Share this question
or