Automatically caluclates position relative to the screen

3 posts, 0 answers
  1. SANDRO
    SANDRO avatar
    2 posts
    Member since:
    Aug 2013

    Posted 11 Dec 2013 Link to this post

    Hi! 

    Anyone know if I need to specify some property specifies to run the automatic calculation of the position of notifications?
    My notifications are on the MasterPage, when I invoke the notification as it overlaps the previous one.
    I wish the notifications is displayed as in the example:
    http://demos.telerik.com/aspnet-ajax/notification/examples/overview/defaultcs.aspx

    thak you.
    Sandro Pinheiro.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Dec 2013 Link to this post

    Hi SANDRO,

    In this 'RadNotification - Telerik's ASP.NET Notification' demo, the Offset value of the first RadNotification is calculated in its Client side event 'OnClientShowing'. Then based on the first offset value, the position for the next RadNotification is calculated and set it through set_offsetY() on the 'ClientShowing' event of the second RadNotification. Please take a look into the below code.

    JavaScript:
    function OnClientShowing(sender, args) {
            if (sender.calculateOffset == false) return;
            for (var i = 0; i < notifications.length; i++) {
                var notification = notifications[i];
                if (sender !== notification && notification.isVisible())
                    sender.set_offsetY(sender.get_offsetY() - notification.get_height());
            }
            sender.calculateOffset = false;
        }
     
        function OnClientHidden(sender, args) {
            sender.set_offsetY(-65);
            sender.calculateOffset = true;
        }

    You can use the same approach for positioning the RadNotification relative to another RadNotification.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. SANDRO
    SANDRO avatar
    2 posts
    Member since:
    Aug 2013

    Posted 16 Dec 2013 Link to this post

    Shinu,
    Thank you for your help.

    Sandro;.
Back to Top