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

Programmatic Creation

1 Answer 92 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Craig Walker
Top achievements
Rank 1
Craig Walker asked on 02 Oct 2011, 10:47 PM
I'd like to dynamically create stacked notifications in codebehind. I tried programmatically creating an instance of RadNotifcation using something like:
Dim RadNotification1 As RadNotification = New RadNotification
RadNotification1.EnableShadow = True
RadNotification1.EnableRoundedCorners = True
RadNotification1.ShowTitleMenu = False
RadNotification1.Text = "You have new messages!<br>date: " & DateTime.Now.ToShortTimeString & "<br><br>"
RadNotification1.Show()

When it fires, though, a generic object error is thrown. Is it possible to programmically or dynamically create notifications?

What I'm trying to do is retreive notification text from a database. But I want to display multiple notifications until the user closes the notification window.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Oct 2011, 10:03 AM
Hi Craig,

What I do not see in your code is where you add the RadNotification control to the page, for example:
form1.Controls.Add(RadNotification1)

This is required for any ASP control you create dynamically and it has to happen before you call its Show() method.

Kind 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
Craig Walker
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or