Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
88 views
Hi there,

Does anyone have a good suggestion on how to achieve something like the header in dateheader.jpg where you display the month at the top followed by week numbers and just small, empty boxes for the dates?

dateheader2.jpg displays what I got today using RadScheduler, but I need to compress the width of the columns ..
Peter
Telerik team
 answered on 01 Jun 2010
1 answer
119 views
Hi,

In my project I am getting the menu items programaticaly from the sql server. The problem I am facing is, how to add IsSeperator  in the database and call in the code?


aspx file

 

<telerik:RadMenu ID="radMenu" runat="server" EnableRoundedCorners="true" EnableShadows="true"

 

 

Skin="Office2007" >

 

 

</telerik:RadMenu>

 

---------------------------------------------------------
cs file

private

 

void buildMenu()

 

{

 

OleDbConnection dbCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/MenusiteMap.mdb"));

 

dbCon.Open();

 

OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM Sitemap_Menu ORDER BY MenuId", dbCon);

 

 

DataSet ds = new DataSet();

 

adapter.Fill(ds);

ds.Relations.Add(

"NodeRelation", ds.Tables[0].Columns["MenuId"], ds.Tables[0].Columns["ParentId"]);

 

 

foreach (DataRow dbRow in ds.Tables[0].Rows)

 

{

 

if (dbRow.IsNull("ParentId"))

 

{

 

RadMenuItem newItem = CreateItem(dbRow);

 

radMenuAcc.Items.Add(newItem);

PopulateSubMenu(dbRow, newItem);

}

}

}

 

 

private RadMenuItem CreateItem(DataRow dbRow)

 

{

 

RadMenuItem item = new RadMenuItem();

 

item.Text = dbRow[

"Text"].ToString();

 

item.NavigateUrl = dbRow[

"NavigateUrl"].ToString();

 

item.ImageUrl = dbRow[

"IconImage"].ToString();

 

item.HoveredImageUrl = dbRow[

"HoverIconImage"].ToString();

 

 

return item;

 

}

 

private void PopulateSubMenu(DataRow dbRow, RadMenuItem item)

 

{

 

foreach (DataRow childRow in dbRow.GetChildRows("NodeRelation"))

 

{

 

RadMenuItem childItem = CreateItem(childRow);

 

item.Items.Add(childItem);

PopulateSubMenu(childRow, childItem);

}

}
----------------------------------------------------
database fields
MenuID, Text, ParentID,Navigateurl,IconImage,HoverIconImage
--------------------------------------------------
Thanks.
Jessy

Peter
Telerik team
 answered on 01 Jun 2010
8 answers
125 views
Hi,

I m having radcombo in inlinetemplate of radscheduler. when i m selecting the value from radcombo the inlinetemplate is disappears for few seconds, and i m binding values from database, & it is done by server side coding.

I dont know whether it is possible to avoid it of not?.

Please find the code i have used,
<telerik:RadScheduler runat="server" ID="RadScheduler1" ShowWeeklyColumnHeader="true" 
                                        ShowViewTabs="false" ShowHeader="true" ShowNavigationPane="true"   
                                         OnClientTimeSlotContextMenu="timeSlotContextMenu" OnClientAppointmentContextMenu="appointmentContextMenu" 
                                        OnClientAppointmentInserting="appointmentInserting" AllowDelete="false" WeekHeaderDateFormat="dd-MMM-yyyy" 
                                        StartEditingInAdvancedForm="false" OnAppointmentCommand="RadScheduler1_AppointmentCommand" 
                                        TimeZoneOffset="00:00:00" OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
                                        OnNavigationComplete="RadScheduler1_NavigationCommand" ShowFullTime="true" OnClientFormCreated="ClientFormCreated" 
                                        OnFormCreated="RadScheduler1_FormCreated" RowHeight="35" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" 
                                        OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" 
                                        OnAppointmentCancelingEdit="RadScheduler1_AppointmentCancelingEdit" OnClientAppointmentMoveEnd="appointmentMoveEnd">  
                                        <TimelineView UserSelectable="false" /> 
                                        <AdvancedForm Modal="true" /> 
                                        <InlineEditTemplate> 
                                            <div style="border: thin solid #008080; font: 11px arial,sans-serif; background: #00FFFF;  
                                                width: 100%"> 
                                                <table> 
                                                    <tr> 
                                                        <td align="left">  
                                                            <br /> 
                                                            <asp:Label ID="Label2" runat="server" AssociatedControlID="StartInput">Description</asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <asp:TextBox ID="txtProgramname" runat="server" Text='<%# Bind("Subject") %>' TextMode="MultiLine" 
                                                                Width="150"></asp:TextBox><br /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            <br /> 
                                                            <asp:Label ID="Label5" runat="server" AssociatedControlID="EndInput">Episode</asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <asp:TextBox ID="txtEpisode" Columns="500" runat="server" Width="150" TextMode="MultiLine"></asp:TextBox><br /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            <asp:Label ID="Label3" AssociatedControlID="StartInput" runat="server">Start time:</asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <telerik:RadTextBox ID="StartInput" Text='<%# Bind("Start") %>' runat="server" Visible="false">  
                                                            </telerik:RadTextBox><telerik:RadDateTimePicker SelectedDate='<%# Bind("Start") %>' 
                                                                ID="Starttime" runat="server" DateInput-DateFormat="dd-MMM-yyyy HH:mm">  
                                                                <DateInput ID="startdate" runat="server" OnClientDateChanged="ClientDateSelected1">  
                                                                </DateInput> 
                                                                <TimeView ID="TimeView2" runat="server" Interval="00:30:00" OnClientTimeSelected="ClientTimeSelected1">  
                                                                </TimeView> 
                                                            </telerik:RadDateTimePicker> 
                                                            <br /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            <asp:Label ID="Label4" AssociatedControlID="EndInput" runat="server">End time:</asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <telerik:RadTextBox ID="EndInput" Text='<%# Bind("End") %>' runat="server" Visible="false">  
                                                            </telerik:RadTextBox> 
                                                            <telerik:RadDateTimePicker ID="Endtime" SelectedDate='<%# Bind("End") %>' runat="server" 
                                                                DateInput-DateFormat="dd-MMM-yyyy HH:mm">  
                                                                <TimeView ID="TimeView1" runat="server" Interval="00:30:00" OnClientTimeSelected="ClientTimeSelected2">  
                                                                </TimeView> 
                                                            </telerik:RadDateTimePicker> 
                                                            <br /> 
                                                        </td> 
                                                    </tr> 
                                                   <tr> 
                                                        <td align="left">  
                                                            <asp:Label ID="Label6" runat="server" CssClass="inline-label">Task:</asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <telerik:RadComboBox ID="cmbtask" Text="--Select--" AutoPostBack="true" runat="server" 
                                                                Enabled="true" ShowDropDownOnTextboxClick="true" OnSelectedIndexChanged="cmbtask_SelectedIndexChanged" 
                                                                OnClientSelectedIndexChanged="clientselectedindexchanged">  
                                                                <Items> 
                                                                    <telerik:RadComboBoxItem Text="Cancel Episodes" Value="CancelEpisodes" /> 
                                                                    <telerik:RadComboBoxItem Text="Add New Programme" Value="AddNewProgramme" /> 
                                                                    <telerik:RadComboBoxItem Text="Change Break Format" Value="ChangeBreakFormat" /> 
                                                                    <telerik:RadComboBoxItem Text="Reschedule Programme" Value="RescheduleProgramme" /> 
                                                                </Items> 
                                                            </telerik:RadComboBox> 
                                                            <br /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td align="left">  
                                                            <asp:Label ID="lbl_CancelingOptions" runat="server" CssClass="inline-label" Visible="false" 
                                                                Text="Options:"></asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            <asp:DropDownList runat="server" ID="drpcc" Visible="false" Width="100">  
                                                            </asp:DropDownList> 
                                                            <telerik:RadComboBox ID="cmb_CancelingOptions" Text="--Select--" runat="server" Visible="true" 
                                                                Enabled="true" ShowDropDownOnTextboxClick="true">  
                                                                <Items> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode and Leave Slot Blank" Value="Cancel this Episode and Leave Slot Blank" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode along with its Repeats" Value="Cancel this Episode along with its Repeats" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel All Occurances of this Programme in this Time Band" 
                                                                        Value="Cancel All Occurances of this Programme in this Time Band" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel All Programmes in this Time Band" Value="Cancel All Programmes in this Time Band" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode and All Subsequent Episodes for the Same Repeat No" 
                                                                        Value="Cancel this Episode and All Subsequent Episodes for the Same Repeat No" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode and All Subsequent Episodes along with Repeats" 
                                                                        Value="Cancel this Episode and All Subsequent Episodes along with Repeats" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode and Pull Subsequent Episodes of the Same Repeat No" 
                                                                        Value="Cancel this Episode and Pull Subsequent Episodes of the Same Repeat No" /> 
                                                                    <telerik:RadComboBoxItem Text="Cancel this Episode and Pull Subsequent Episodes in the Same Time Band" 
                                                                        Value="Cancel this Episode and Pull Subsequent Episodes in the Same Time Band" /> 
                                                                </Items> 
                                                            </telerik:RadComboBox> 
                                                            <br /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td colspan="2" align="center">  
                                                            <asp:LinkButton ID="OK" runat="server" CommandName="OK" Text="OK" Visible="false">  
                                  
                                                            <asp:LinkButton ID="ok_reschedule" runat="server" CommandName="ok_reschedule" Text="OK" 
                                                                Visible="true" OnClientClick="confirmCall()"></asp:LinkButton> 
                                                            <asp:LinkButton ID="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" 
                                                                Style="margin-right: 8px;" Text="Cancel">  
                                  
                                  
                                </asp:LinkButton> 
                                                        </td> 
                                                          
                                                    </tr> 
                                            </div> 
                                            </table> </div> 
                                        </InlineEditTemplate> 
                                    </telerik:RadScheduler> 

Please give any suggestion to solve it.

Regards
Maha;)

Peter
Telerik team
 answered on 01 Jun 2010
1 answer
200 views
The following scenario may be highly unusual, but I am supporting a legacy asp app that my boss doesn't want to kill and keeps wanting to add new features.

I am using a Rad Editor embedded in an aspx page.  This aspx page is referenced by an asp page using an IFrame control.  Occassionally an OutOfMemoryException is thrown when the RadEditor tries to load. 

Any insight would be appreciated.

-----------------------------------------------------------------
asp page

<

 

iframe name="DiagnosisEditor" id="DiagnosisEditor"

 

 

src="../Diagnosis/DiagnosisEditor.aspx" ></iframe>
------------------------------------------------------------------
aspx page

 

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="DiagnosisEditor.aspx.cs" Inherits="Diagnosis_DiagnosisEditor" %>

 

<%

@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

 

 

 

 

Namespace="System.Web.UI" TagPrefix="asp" %>

 

<%

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

 

 

 

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head id="Head1" runat="server">

 

<

 

script type="text/javascript">

 

 

 

 

 

function ExecuteCommand(command)

 

{

$find(

"RadEditor1").fire(command);

 

}

 

function AlertSelectedHtml()

 

{

alert($find(

"RadEditor1").getSelectionHtml());

 

}

 

 

function GetHtml() {

 

 

return $find("RadEditor1").get_html(true);

 

}

 

function SetHtml(html)

 

{

$find(

"RadEditor1").set_html(html);

 

}

 

function loaddiagnosis() {

 

$find(

"RadEditor1").set_html("nnnn");

 

}

 

function OnClientLoad(editor) {

 

 

var diagnosishtml = parent.parent.document.forms[0].giDiagnosisHTML.value ;

 

editor.set_html(diagnosishtml);

}

 

 

</script>

 

</

 

head>

 

<

 

body onload="">

 

 

 

 

 

<script type="text/javascript">

 

 

 

 

 

 

</script>

 

 

 

 

 

<form id="form1" runat="server" >

 

 

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>

 

 

 

 

 

<telerik:RadEditor ID="RadEditor1" Runat="server" Height="400px" Width="800px"

 

 

Skin="Telerik" EditModes="All" ToolbarMode="Default" OnClientLoad="OnClientLoad">

 

 

 

 

 

<Content/>

 

 

 

 

 

<CssFiles>

 

 

 

 

 

<telerik:EditorCssFile Value="radstyle.css" />

 

 

 

 

 

</CssFiles>

 

 

 

 

 

</telerik:RadEditor>

 

 

 

 

 

</form>

 

</

 

body>

 

</

 

html>

 

 

 

----------------------------------------------------------------------------------------------------------------------------------------------------


The following is the stack trace:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Exception of type 'System.OutOfMemoryException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +54
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
   System.Reflection.Assembly.Load(String assemblyString) +25
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +211
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
   System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +267
   System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +39
   System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +429
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +75
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +582
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161

 

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433





Rumen
Telerik team
 answered on 01 Jun 2010
1 answer
109 views
Hello,
I am building a custom GIS Web application using ESRI ArcGIS Server Technology.
In the application, I have couple of UserControls that contains RadGrid Control.
I am using ajaxtoolkit DragPanelExtender to display my usercontrols when user clicks on a
RadMenu. (works like a window popup and I am able to move the popups around by dragging)
In my application I have another usercontrol that is provided by ESRI which allow users to draw a line or polygon on the map control
to measure distance or boundary. Whenever, I tried to use this tool, I am getting title mentioned
javascript error. (Please see the attachment)
And if I remove my usercontrols that contain RadGrid, I don't get the error messages.

Has anyone seen this type of error before? What is the problem here?

I am using RadControl 2008 Q2 version.

thanks

Don Kang
Nikolay Rusev
Telerik team
 answered on 01 Jun 2010
1 answer
48 views
Hi,
I had a problem using radgrid with dynamicdata and I got a solution in the following post: Solution. Now I tried to find the same solution
using Google or Telerik site and it is hard to find the latest one. For example I got into this telerik blog but I think it has an older version than the one from the solution I got (it might have some fixes or something).
In general I think it is harder to maintain info about some code just using forums because the poster might give a wrong post title making it harder to find and is unclear if a post has the latest version of code or not.
So my question is:
1. In this particular case with dynamic data how can I find the latest telerik implementation if I have to use it after x months from now?
2. In general how can I find the latest implementation of a feature that is not part of the official telerik package without asking question on forums?
Nikolay Rusev
Telerik team
 answered on 01 Jun 2010
1 answer
583 views
Hi,

Please help me with the following issue:
I want to disable the selection on parent node in this code below

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DisableNodeSelected.aspx.cs" Inherits="Portal.Demo.RadControls.RadTreeView.DisableNodeSelected" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
        <telerik:RadTreeView ID="RadTreeView1" runat="server"
            <Nodes> 
                <telerik:RadTreeNode Text="Parent 1" Value="Parent 1" Selected="true"
                    <Nodes> 
                        <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                        <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                        <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                        <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                        <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                    </Nodes> 
                </telerik:RadTreeNode> 
                <telerik:RadTreeNode Text="Parent 2" Value="Parent 2"
                    <Nodes> 
                        <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                        <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                        <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                        <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                        <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                    </Nodes> 
                </telerik:RadTreeNode> 
            </Nodes> 
        </telerik:RadTreeView> 
    </div> 
    </form> 
</body> 
</html> 
 


Nikolay Tsenkov
Telerik team
 answered on 01 Jun 2010
5 answers
77 views
Hello

By removing RadScriptManager from my web page and dragging it on my MasterPage, the items in the RadTabStrip disappeared.
I read this article http://www.telerik.com/help/aspnet-ajax/radscriptmanager.html but what I should do ???

Thanks

Best Regards
Peter
Telerik team
 answered on 01 Jun 2010
3 answers
176 views
I was wondering if the following is possible, either through ItemTemplates, or through pure CSS:

I want to style my top level items with a custom theme like Office 2010 [Office 2010 like theme]. I can override the background image:

DIV.RadPanelBar .rpRootGroup .rpSelected
{
    background: url("Images/static.png") no-repeat scroll right -304px transparent;
    background-color:transparent;
}

but we miss the left hand border. Obviously to get this, we need another another image (this is done with another <span> element that wraps the .rpSelected element), but in your model there is no element that we can apply the background image too.

Is there a way to do this at design time? I really don't want to have to pluck out each .rpSelected and wrap it with my own <span> at runtime with JQuery...
Greg
Top achievements
Rank 1
 answered on 01 Jun 2010
1 answer
110 views

Working in IE 8, mostly, but trying to write a portable solution for modern browsers.

I'm catching the 'Showing' client-side event of the RadContextMenu and trying to adjust it's coordinates. The clientX, clientY and x,y members of the DOM event cannot be assigned a new value. Visual Studio breaks with a "htmlfile: Member not found" error.

My goal is to get a RadContextMenu to show inside a RadEditor when the user clicks in it (under certain conditions, this is a requirement from management). So I capture the onclick event for the RadEditor's content area (radEditor.get_document().body;). I then call show(evt) on the context menu, where 'evt' is the event object corresponding to the click event.

Because the RadEditor's content is in an IFRAME, you have to adjust the position of the click event before the context menu displays. This is done in the "Showing" event. However, I cannot assign a value to the members .clientX and friends. It's as if javascript has temporarily forgotten about integer + and += operators.

Is it possible that these members have become readonly/const at some point?

window.onload = function() { 
    //details is the radeditor 
 
    setTimeout(function() { 
        var node = $find(details).get_document().body; 
        if (node.attachEvent) 
            node.attachEvent("onclick", reDetails_InsideClick); 
        else 
            node.addEventListener("click", reDetails_InsideClick, false); 
    }, 250); 
 
 

function reDetails_InsideClick(e) { 
    e = e || event; 
 
    var btnContext = $find(toolbarBottom).findItemByValue("Context"); 
    if (btnContext.get_checked()) { //Trivial application logic. 
        var rcm = $find(atcmContext); //atcmContext is the context menu 
        if(!e.target) 
            e.target = e.srcElement; //For some reason e.target is undefined here 
        rcm.show(e); 
    } 

function rcmAutoText_Showing(sender, args) { 
    var node = /*get the editor's IFRAME element*/ 
    var evt = args.get_domEvent(); 
 
    while (node) { 
        evt.offsetX += node.offsetLeft; //Crashes Here: 'Member not found.' 
        evt.offsetY += node.offsetTop; 
        node = node.offsetParent; 
    } 
    evt.clientY += sender.get_element().clientHeight; 

Peter
Telerik team
 answered on 01 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?