Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
155 views
Hi All,

I would like a button that inserts an Iframe with a predefined link. The reason I would like that is so that in Wiki, I can insert a menu on top of every wiki. When a user create a new page, all he would have to do is press the button to insert the menu (iframe)?
 
Any Idea?

Antoine
Antoine
Top achievements
Rank 1
 answered on 15 Oct 2007
1 answer
157 views
Hi

I am getting this error in IE 7 when loading my web page.

You can see the error on my site at http://daresoft.no-ip.co.uk/the-dl-outlet

I have sopent hours trying to find the cause of it but I cannot.

Would be grateful for any helpo you might be able to provide.

Kind Regards

David

Steve
Telerik team
 answered on 15 Oct 2007
1 answer
99 views
Hi!
Prometheus seems to be lacking PanelBar control. Can it be emulated with Sliding Pane?  Do you have a example?

Thanks!
Petya
Telerik team
 answered on 15 Oct 2007
1 answer
127 views

Hi there,

one of the examples for the RadSlider shows how to create objects in client side. Can we do the same with RadDock and other Prometheus controls?

 


<script> 
                function CreateSlider()  
                {  
                    var sliderProps = {  
                        Value : 50                          
            
        }  
                    var sliderEvents = {}; // we do not need events  
                    var elementToExtend = $get("ClientSlider"); // replace this element with a new RadSlider  
                    $create(Telerik.Web.UI.RadSlider, sliderProps, sliderEvents, null, elementToExtend);  
                }  
            </script> 
 
 

Petya
Telerik team
 answered on 15 Oct 2007
1 answer
110 views
In the application I'm working on, we need the ability to show appointments that span multiple days.  The recent service pack fixed the problem with the month view, but we're still having a problem with the week view.

If we specify an appointment that starts in one day and ends two days later, the middle day only shows up in the all day row.  This is confusing the users since they percieve that the middle day is empty.  Is there any way to force the appointment to show as an all day appointment in the middle days?

Thanks,
Chris
Peter
Telerik team
 answered on 15 Oct 2007
1 answer
251 views
Hey,

I noticed with your examples that you are using the WindowManager.  In the overview of the new Window Control with Prometheus, you say you do not need the window manager.  Is there anything specific I need to do in order to use it without the Window Manager?

I ran two test using the following code.  It works when you have the Window Manager, but does not work without the Window Manager.

 

<script type="text/javascript">  
function openRadWindow(url, windowname)  
{  
    var oWnd = radopen(url, windowname);  
}  
</script> 
 
<asp:LinkButton ID="btnEditProfile" runat="server" Text="Edit Profile" OnClientClick="openRadWindow('../IT/EditProfile.aspx', 'Edit Profile'); return false;"></asp:LinkButton></span>  
 
<telerik:RadWindowManager ID="test" runat="server">  
<Windows> 
<telerik:RadWindow ID="testing" runat="server"></telerik:RadWindow> 
</Windows> 
</telerik:RadWindowManager> 
 

Thanks,
Bob
Georgi Tunev
Telerik team
 answered on 15 Oct 2007
4 answers
248 views
I'm just starting to ajaxify the stuff that we already have working and I'm running into some weird things:

1.  I cannot for the life of me get a javascript to force an ajax request from a AjaxPanel. I do this <%=radPnl.ClientID%>.AjaxRequest(null); and it always comes back with a script error that the object doesn't have that method.  How do I get it to work?

2. Where did the timer stuff go that was in the original Telerik controls for setting timers?  Right now I've made it refresh periodically using a microsoft timer inside the ajax panel which seems to work ok, but I don't think it's optimal. (and it won't display the loading panel.)

3. I'm looking for an example of ajaxifying a multipage.  Basically I want to have a tab control that loads the pages dynamically.  Further, I don't want the code that loads right now on the Page_Load of my user controls to fire at all until they are requested which is happening right now. I'm a little confused as to how this is supposed to work.

Thanks!
Rational Animal
Top achievements
Rank 1
 answered on 15 Oct 2007
1 answer
186 views
I set my tooltip position to the top-left of my elements so that on mouseover the tooltip positions itself away from the element and allows room for the user to still right-click on the element to bring up a context menu. However, the positioning is really poor. I had to disable the callouts as they never lined up with the element, and the tooltips (particulary ones with more height) always seem to cover my element - i.e. drifting down and right. I wanted the bottom-left of the tooltip to be at the top-right of my element as per the examples in the "Positioning" section of the tutorial. I would expect this to happen if a tooltip opened close to the screen boundary but it seems to happen all the time. Is this a recognised problem and is there a workaround?
Georgi Tunev
Telerik team
 answered on 15 Oct 2007
3 answers
242 views
I have defined a custom dbSchedulerProvider for my scheduler and when I run the appication I get a NullReference Exception. When i set a break point in different functions, it throws the error after the call to GetResourcesByType().  I wish to know what I am doing wrong here.


Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadScheduler.BindResourcesFromProvider(IEnumerable`1 providedResourceTypes) +165
   Telerik.Web.UI.RadScheduler.PerformSelect() +147
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
   Telerik.Web.UI.RadScheduler.EnsureDataBound() +74
   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +65
   Telerik.Web.UI.RadScheduler.CreateChildControls() +29
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

Provider file:

using System;

using System.Collections.Generic;

using System.Collections.Specialized;

using System.Configuration;

using System.Configuration.Provider;

using System.Data;

using System.Data.Common;

using System.Data.SqlClient;

using Telerik.Web.UI;

public class WorldBridgeSchedulerProvider : DbSchedulerProviderBase

{

public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)

{

List<Appointment> exceptions = new List<Appointment>();

using (DbConnection conn = OpenConnection())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

cmd.CommandText = "SELECT [VACExceptionID], [Reason], [StartDate], [EndDate], [RecurrenceRule], [RecurrenceParentId] FROM [VACException]";

using (DbDataReader reader = cmd.ExecuteReader())

{

while (reader.Read())

{

Appointment apt = new Appointment();

apt.Owner = owner;

apt.ID = reader["VACExceptionID"];

apt.Subject = Convert.ToString(reader["Reason"]);

apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(reader["StartDate"]), DateTimeKind.Utc);

apt.End = DateTime.SpecifyKind(Convert.ToDateTime(reader["EndDate"]), DateTimeKind.Utc);

apt.RecurrenceRule = Convert.ToString(reader["RecurrenceRule"]);

apt.RecurrenceParentID = reader["RecurrenceParentId"] == DBNull.Value ? null : reader["RecurrenceParentId"];

if (apt.RecurrenceParentID != null)

{

apt.RecurrenceState = RecurrenceState.Exception;

}

else

if (apt.RecurrenceRule != string.Empty)

{

apt.RecurrenceState = RecurrenceState.Master;

}

LoadResources(apt);

exceptions.Add(apt);

}

}

}

return exceptions;

}

public override void Insert(RadScheduler owner, Appointment appointmentToInsert)

{

if (!PersistChanges)

{

return;

}

using (DbConnection conn = OpenConnection())

{

using (DbTransaction tran = conn.BeginTransaction())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

cmd.Transaction = tran;

PopulateAppointmentParameters(cmd, appointmentToInsert);

cmd.CommandText =

@" INSERT INTO [VACException]

([Reason], [StartDate], [EndDate], [VACID],

[RecurrenceRule], [RecurrenceParentID])

VALUES (@Reason, @StartDate, @EndDate, @VACID,

@RecurrenceRule, @RecurrenceParentID)";

if (DbFactory is SqlClientFactory)

{

cmd.CommandText += Environment.NewLine + "SELECT SCOPE_IDENTITY()";

}

else

{

cmd.ExecuteNonQuery();

cmd.CommandText = "SELECT @@IDENTITY";

}

int identity = Convert.ToInt32(cmd.ExecuteScalar());

//FillClassStudents(appointmentToInsert, cmd, identity);

tran.Commit();

}

}

}

public override void Update(RadScheduler owner, Appointment appointmentToUpdate)

{

if (!PersistChanges)

{

return;

}

using (DbConnection conn = OpenConnection())

{

using (DbTransaction tran = conn.BeginTransaction())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

cmd.Transaction = tran;

PopulateAppointmentParameters(cmd, appointmentToUpdate);

cmd.Parameters.Add(CreateParameter("@VACExceptionID", appointmentToUpdate.ID));

cmd.CommandText = "UPDATE [VACException] SET [Reason] = @Reason, [StartDate] = @StartDate, [EndDate] = @EndDate, [VACID] = @VACID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID WHERE [VACExceptionID] = @VACExceptionID";

cmd.ExecuteNonQuery();

//ClearClassStudents(appointmentToUpdate.ID, cmd);

//FillClassStudents(appointmentToUpdate, cmd, appointmentToUpdate.ID);

tran.Commit();

}

}

}

public override void Delete(RadScheduler owner, Appointment appointmentToDelete)

{

if (!PersistChanges)

{

return;

}

using (DbConnection conn = OpenConnection())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

using (DbTransaction tran = conn.BeginTransaction())

{

cmd.Transaction = tran;

//ClearClassStudents(appointmentToDelete.ID, cmd);

cmd.Parameters.Clear();

cmd.Parameters.Add(CreateParameter("@VACExceptionID", appointmentToDelete.ID));

cmd.CommandText = "DELETE FROM [VACException] WHERE [VACExceptionID] = @VACExceptionID";

cmd.ExecuteNonQuery();

tran.Commit();

}

}

}

public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)

{

ResourceType[] resourceTypes = new ResourceType[2];

resourceTypes[0] = new ResourceType("VAC", false);

return resourceTypes;

}

public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)

{

switch (resourceType)

{

case "VAC":

return GetVACs();

default:

throw new InvalidOperationException("Unknown resource type: " + resourceType);

}

}

private void LoadResources(Appointment apt)

{

using (DbConnection conn = OpenConnection())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

cmd.Parameters.Add(CreateParameter("@VACExceptionID", apt.ID));

cmd.CommandText = "SELECT [VACID] FROM [VACException] WHERE [VACExceptionID] = @VACExceptionID AND [VACID] IS NOT NULL";

using (DbDataReader reader = cmd.ExecuteReader())

{

if (reader.Read())

{

Resource VAC = apt.Owner.Resources.GetResource("VAC", reader["VACID"]);

apt.Resources.Add(VAC);

}

}

}

}

private IEnumerable<Resource> GetVACs()

{

List<Resource> resources = new List<Resource>();

using (DbConnection conn = OpenConnection())

{

DbCommand cmd = DbFactory.CreateCommand();

cmd.Connection = conn;

cmd.CommandText = "SELECT [VACID], [VACName] FROM [VAC]";

using (DbDataReader reader = cmd.ExecuteReader())

{

while (reader.Read())

{

Resource res = new Resource();

res.Type = "VAC";

res.Key = reader["VACID"];

res.Text = Convert.ToString(reader["VACName"]);

resources.Add(res);

}

}

}

return resources;

}

private void PopulateAppointmentParameters(DbCommand cmd, Appointment apt)

{

cmd.Parameters.Add(CreateParameter("@Reason", apt.Subject));

cmd.Parameters.Add(CreateParameter("@StartDate", apt.Start));

cmd.Parameters.Add(CreateParameter("@EndDate", apt.End));

Resource VAC = apt.Resources.GetResourceByType("VAC");

object VACID = null;

if (VAC != null)

{

VACID = VAC.Key;

}

cmd.Parameters.Add(CreateParameter("@VACID", VACID));

string rrule = null;

if (apt.RecurrenceRule != string.Empty)

{

rrule = apt.RecurrenceRule;

}

cmd.Parameters.Add(CreateParameter("@RecurrenceRule", rrule));

object parentId = null;

if (apt.RecurrenceParentID != null)

{

parentId = apt.RecurrenceParentID;

}

cmd.Parameters.Add(CreateParameter("@RecurrenceParentId", parentId));

}

}


Create Scripts for the tables:
CREATE TABLE [dbo].[VAC](
 [VACID] [int] IDENTITY(1,1) NOT NULL,
 [VACName] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
 CONSTRAINT [PK_VAC_1] PRIMARY KEY CLUSTERED
(
 [VACID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


CREATE TABLE [dbo].[VACException](
 [VACExceptionID] [int] IDENTITY(1,1) NOT NULL,
 [VACID] [int] NOT NULL,
 [StartDate] [datetime] NOT NULL,
 [EndDate] [datetime] NOT NULL,
 [Reason] [nvarchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [RecurrenceRule] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [RecurrenceParentID] [int] NULL,
 CONSTRAINT [PK_VACException] PRIMARY KEY CLUSTERED
(
 [VACExceptionID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
GO
ALTER TABLE [dbo].[VACException]  WITH CHECK ADD  CONSTRAINT [FK_VACException_VAC] FOREIGN KEY([VACID])
REFERENCES [dbo].[VAC] ([VACID])


Dheepa
Top achievements
Rank 1
 answered on 15 Oct 2007
1 answer
181 views
Hi, I am develope whit prometeus tool tip and i have this problem when i copy the files to production server but in my dve pc works great!!!

Please Help me!!!

Georgi Tunev
Telerik team
 answered on 15 Oct 2007
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?