Notification ontop of another notification?

3 posts, 0 answers
  1. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 07 Nov 2011 Link to this post

    I have multiple notifications that i can adding to a placeholder dynamically. Is it possible to make sure that these notifications show one above another and not on top or hiding one another? Similar to the demo here:

    http://demos.telerik.com/aspnet-ajax/notification/examples/default/defaultcs.aspx

    Any ideas?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 09 Nov 2011 Link to this post

    Hi Duncan,

    The demo you linked uses JavaScript to check if other notifications are visible and if so - changes the offsetY. Please examine its code carefully, as it is rather complex. You can find the entire demo site installed locally under the Live Demos folder in your RadControls for ASP.NET AJAX installation. Thus you can examine it in VS and modify it if need be.

    In case you are showing them from the server you can simply have a counter that you increase with the height of the notification, whose Show() method you have just called (plus some spacing if you like), then set this counter as the OffsetY property (with a negative sign, of course) of the next notification you are showing and so on and so forth for all the needed controls.


    Best wishes,
    Marin
    the Telerik team
    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 their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Nov 2011 Link to this post

    Hello Duncan,

    You can try the following code snippet.
    C#:
    protected void Page_Load(object sender, EventArgs e)
      {
          RadNotification notification1 = new RadNotification();
          notification1.ID = "RadNotification1";
          notification1.Width =  Unit.Pixel(300);
          notification1.Height = Unit.Pixel(100);
          notification1.Animation = NotificationAnimation.Fade;
          notification1.EnableRoundedCorners = true;
          notification1.VisibleTitlebar = false;
          notification1.Text = "Haiiiiiiii";
          notification1.AutoCloseDelay = 500;
          notification1.ShowInterval = 1000;
          notification1.Position=NotificationPosition.BottomLeft;
          notification1.OffsetX = 45;
          notification1.OffsetY = -65;
          notification1.ShowCloseButton=true;
          PlaceHolder1.Controls.Add(notification1);
          RadNotification notification2 = new RadNotification();
          notification2.ID = "RadNotification2";
          notification2.Width = Unit.Pixel(300);
          notification2.Height = Unit.Pixel(100);
          notification2.Animation = NotificationAnimation.Fade;
          notification2.EnableRoundedCorners = true;
          notification2.VisibleTitlebar = false;
          notification2.AutoCloseDelay = 500;
          notification2.Text = "Helloooo";
          notification2.ShowInterval = 1000;
          notification2.Position = NotificationPosition.BottomLeft;
          notification2.OffsetX = 45;
          notification2.OffsetY = -200;
          notification2.ShowCloseButton = true;
          PlaceHolder1.Controls.Add(notification2);
      }

    Thanks,
    Princy.
Back to Top