<telerik:RadMenu ID="radMenu" runat="server" EnableRoundedCorners="true" EnableShadows="true"
Skin="Office2007" >
</telerik:RadMenu>
---------------------------------------------------------
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
| <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> |
<
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

| <%@ 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> |
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; |
| } |