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

Using notification for notes

1 Answer 106 Views
Notification
This is a migrated thread and some comments may be shown as answers.
FEST
Top achievements
Rank 1
FEST asked on 17 Oct 2011, 03:23 PM
Hi forum.

I'm trying to use the radnotification to be used as a note. In my page i have a radbutton and every time someone clicks it i want for a new radnotification to be created. I also would like to make it able for the user change the position of the radnotification by mouse using drag, I don't know if it is possible. My problems are that, i can only create one radnotification at a time, if i have one created and i hit the radbutton again the first radnotification dissapears and the new one appears, is it not possible to create a sort of notoficationfactory?.

Here goes my code:
Private Const width As Integer = 300
Private Const height As Integer = 100
Dim number As Integer = 0
Protected Sub RadButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButton1.Click
    Dim text As RadTextBox = New RadTextBox()
    text.Width = Unit.Pixel(200)
    Dim note As RadNotification = New RadNotification()
    note.Width = Unit.Pixel(width)
    note.Height = Unit.Pixel(height)
    note.AutoCloseDelay = 0
    note.Pinned = False
    note.Position = NotificationPosition.Center
    note.ShowCloseButton = True
    note.ContentIcon = Nothing
    note.TitleIcon = Nothing
    note.ID = "RadNotification" & number
    form1.Controls.Add(note)
    note.Show()
End Sub

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 19 Oct 2011, 09:01 AM
Hi,

Please note that when creating controls dynamically you need to recreate them after each postback or they will be disposed as they were not originally in the control tree. This is the way ASP works and this limitation also applies to the RadNotification. A simple example is available in this FAQ thread from the ASP forum and you can also examine this online demo that also shows a way of recreating controls after an AJAX request. It shows how to work with user controls, yet the logic for recreating a control is up to the developer.

As for dragging the notification - this is not possible and it not supported by the RadNotification. There are two other draggable controls in the suite, however - the RadWindow and the RadDock.

If you want the user to receive multiple messages and that they are draggable you may consider the RadAlert dialog.


Regards,
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
Tags
Notification
Asked by
FEST
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or