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

Notification ontop of another notification?

2 Answers 77 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Duncan
Top achievements
Rank 2
Duncan asked on 08 Nov 2011, 01:28 AM
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 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Nov 2011, 09:01 AM
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
0
Princy
Top achievements
Rank 2
answered on 09 Nov 2011, 09:02 AM
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.
Tags
Notification
Asked by
Duncan
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Princy
Top achievements
Rank 2
Share this question
or