Expand Notification Upwards

3 posts, 1 answers
  1. jwhitley
    jwhitley avatar
    41 posts
    Member since:
    Oct 2006

    Posted 07 Aug 2013 Link to this post

    I want to display a single notification at the lower right of the browser window. Within this notification is an expandable DIV element.

    When the DIV is expanded, the notification height changes OK, but it expands downwards off the screen. I want it to expand upwards, so the lower position of the notification remains constant.

    How would I achieve this?

  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    4438 posts

    Posted 09 Aug 2013 Link to this post


     An HTML element has its top fixed and when its height expands it grows downward. The RadNotification control is no exception - it has position: fixed then the top and left properties are calculated according to the browser viewport.

    What I can suggest is that you use the control's client-side API and set its width and height accordingly (i.e. increase the height as much as you need).
    <telerik:RadNotification ID="RadNotification1" runat="server" VisibleOnPageLoad="true"
        AutoCloseDelay="0" Position="BottomRight" Width="200px" Height="150px">
            <div class="test">
                <asp:Button ID="Button1" Text="change div height" OnClientClick="changeDivHeight(); return false;"
                    runat="server" />
    function changeDivHeight()
        var heightDiff = 100;
        var theDiv = $telerik.$(".test");
        theDiv.height(theDiv.height() + heightDiff);
        var notification = $find("<%=RadNotification1.ClientID %>");
        notification.setSize(notification.get_width(), notification.get_height() + heightDiff);
        background-color: Yellow;
        height: 100px;

    Marin Bratanov
    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. jwhitley
    jwhitley avatar
    41 posts
    Member since:
    Oct 2006

    Posted 09 Aug 2013 Link to this post

    Thanks for the reply Marin.

    I wasn't sure how to calculate the increase in DIV height accurately (it expands based in dynamic content), but based on your example, I simply added the code:


    notification.setSize(notification.get_width(), notification.get_height());


    and it works perfectly.

    Thanks again!

Back to Top