Stack Notifications with VisibleOnPageLoad = True

2 posts, 1 answers
  1. Fit2Page
    Fit2Page avatar
    407 posts
    Member since:
    Feb 2007

    Posted 18 Aug 2011 Link to this post


    I have several Notifications which are activated OnPostback setting VisibleOnPageLoad = True from codebehind.

    How do i stack these? They are all shown all in same position now.

  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    4440 posts

    Posted 19 Aug 2011 Link to this post

    Hello Marc,

    You can use the OffsetY position and set it accordingly: for the second notification it should be the height of the first, for the third it should be the combined height of the first and the second, etc. Here follows a small example:
    <telerik:RadNotification runat="server" ID="RadNotification1" Text="I am number 1"
        Width="200px" Height="120px" VisibleOnPageLoad="true">
    <telerik:RadNotification runat="server" ID="RadNotification2" Text="I am the second one"
        Width="200px" Height="120px" VisibleOnPageLoad="true" OffsetY="-120">

    You could, of course modify this value so that they have some space between them, or overlap, etc

    You can also set these properties from the code-behind as well.

      On a side note, you can also call its server-side Show() method instead of setting this property, as if you use the property if another element causes a postback the notifications will reappear, which may not be the desired effect. Well, if it is - no harm done in saying :)

    Best wishes,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top