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

[Solved] Scheduler in WebPart

19 Answers 203 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 14 Dec 2007, 06:33 PM
RadControls for ASP.NET required me to set the property RadControlsDir for each control I added to a web part.  I noticed this does not exist for the Prometheus controls.  Is there another way of pointing the prometheus control to the skins dir?

When I have a prometheus control in my web part, I get the following error:
"An unexpected error has occured."

19 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Dec 2007, 03:36 PM
Hi Scott,

Please, refer to the Skin registration help topic and let us know if you have further questions.


Regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 02:32 PM
i've registered the css file by using the programmatic method on the registration page, as follows:

HtmlLink link = new HtmlLink();
link.Href = "~/layouts/RadControlsPrometheus/Default/Scheduler.Default.css";
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
Page.Header.Controls.Add(link);

i've also set the .Skin property of the scheduler control to the Default skin.  i'm still getting the error "An unexpected error has occured".  i cannot find any logs for this error.

is what i'm attempting possible?
0
Peter
Telerik team
answered on 17 Dec 2007, 02:47 PM
Hi Scott,

It looks like the error is not caused by the skin or the registration of the skin. Can you try using the default settings of RadScheduler and the built-in skins and check if  you still get the same error?


Greetings,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 02:53 PM
to give you a further description of what i'm doing, i have a web part created with 1 method: createchildcontrols.  code in createchildcontrols is as follows:

protected override void CreateChildControls()
{
try
{
// add skin css to header of page
HtmlLink link = new HtmlLink();
link.Href = "~/_layouts/RadControlsPrometheus/Default/Scheduler.Default.css";
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
Page.Header.Controls.Add(link);

// create scheduler
ctrlScheduler = new RadScheduler();
ctrlScheduler.ID = "testScheduler";
ctrlScheduler.EnableEmbeddedSkins = true;
ctrlScheduler.Skin = "";
ctrlScheduler.SelectedDate = DateTime.Today;
ctrlScheduler.SelectedView = SchedulerViewType.MonthView;
this.Controls.Add(ctrlScheduler);
}
catch (Exception e)
{
}
}

assuming this is as default as you can get with the radscheduler control...
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 02:54 PM
i was under the impression that the prometheus controls had skin information embedded within the dll, so i technically should not have to point to a skin at all...


0
Peter
Telerik team
answered on 17 Dec 2007, 02:59 PM
Hello Scott,

That's correct. If you don't specify a skin, the Default one will be used. However, you are not limited to the Default skin since other skins as embedded in the resource file as well.


All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 03:05 PM
ok, so based on your response, i technically don't need to set the below properties at all:

ctrlScheduler.EnableEmbeddedSkins
ctrlScheduler.Skin

by default, they should be true and default skin.

i am still getting the error i stated to start this thread.

if my code looks fine, then i am completely lost as to what is happening.  i have the following referenced in my web part:

using Telerik.Web.UI;

and i have the Telerik.Web.UI.dll in my GAC.

is there anything i'm missing?
0
Peter
Telerik team
answered on 17 Dec 2007, 03:14 PM
Hello Scott,

Can you send us your web part code so we can test it locally?

Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 03:18 PM
peter,

i have the .cs file ready to send; how do i get it to you?
0
Peter
Telerik team
answered on 17 Dec 2007, 03:20 PM

You can open a new support ticket and attach files there. Or, you can paste the c# and aspx code here.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 03:22 PM
below is my code for the web part; it is about as simple as you can get to have the radscheduler show:

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

using Telerik.Web.UI;

namespace BCCS.MOSS.WP.EventScheduler
{
[Guid("c4084ce5-57e9-4c37-bb4f-661745c20242")]
public class EventScheduler : System.Web.UI.WebControls.WebParts.WebPart
{
private Label ctrlLabel;
private RadScheduler ctrlScheduler;

public EventScheduler()
{
this.ExportMode = WebPartExportMode.All;
}

protected override void CreateChildControls()
{

// create scheduler
ctrlScheduler = new RadScheduler();
ctrlScheduler.ID = "testScheduler";
ctrlScheduler.SelectedDate = DateTime.Today;
ctrlScheduler.SelectedView = SchedulerViewType.MonthView;
this.Controls.Add(ctrlScheduler);

// create label
ctrlLabel = new Label();
ctrlLabel.ForeColor = System.Drawing.Color.Red;
//ctrlLabel.Text = "test new web part.";
this.Controls.Add(ctrlLabel);
}
}
}

0
Scott
Top achievements
Rank 1
answered on 17 Dec 2007, 08:35 PM
could the installation of wss and moss sp1 have anything to do with it?
0
Scott
Top achievements
Rank 1
answered on 18 Dec 2007, 01:31 PM
i am not attempting to create an .ascx or embed this control in an .aspx page.  i am simply trying to reference the RadScheduler control for use in a moss 2007 web part.  any ideas?
0
Wendy
Top achievements
Rank 1
answered on 18 Dec 2007, 03:57 PM
I am having the same issue.

Everything worked fine when I was using RadControls for ASP.NET, but when I try adding a prometheus control to my web part I get the error "An unexpected error has occured." Any suggestions?
0
Peter
Telerik team
answered on 19 Dec 2007, 03:51 PM
Hello,

MOSS 2007 doesn't use ASP.NET Ajax. Please, make sure you have a script manager in the page.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 19 Dec 2007, 04:31 PM
understood, but sp1 was supposed to incorporate asp.net ajax support.
0
Peter
Telerik team
answered on 21 Dec 2007, 12:42 PM

Do you experience this problem with SP1?


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 21 Dec 2007, 02:09 PM
under sp1, i need to update the web.config and use a scriptmanager for the prometheus controls to work.
0
Peter
Telerik team
answered on 21 Dec 2007, 02:36 PM
Hello Scott,

Thanks for the feedback. Indeed, the scipt manager is required.

Greetings,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Scott
Top achievements
Rank 1
Answers by
Peter
Telerik team
Scott
Top achievements
Rank 1
Wendy
Top achievements
Rank 1
Share this question
or