| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="Default9" %> |
| <%@ 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 runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <script type="text/javascript"> |
| function nodeClicking(sender, args) |
| { |
| var comboBox = $find("<%=RadComboBox1.ClientID%>"); |
| var node = args.get_node() |
| comboBox.set_text(node.get_text()); |
| comboBox.set_value(node.get_value()); |
| comboBox.hideDropDown(); |
| } |
| </script> |
| <div> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </telerik:RadAjaxManager> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="RadComboBox1" ShowToggleImage="True" OnItemsRequested="ItemsRequested" Runat="server"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| <ItemTemplate> |
| <telerik:RadTreeView ID="RadTreeView1" |
| OnClientNodeClicking="nodeClicking" Runat="server"> |
| </telerik:RadTreeView> |
| </ItemTemplate> |
| <Items> |
| <telerik:RadComboBoxItem Selected="True"></telerik:RadComboBoxItem> |
| </Items> |
| </telerik:RadComboBox> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using Telerik.Web.UI; |
| using System.Xml.Linq; |
| public partial class Default9 : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!IsPostBack && !RadAjaxManager1.IsAjaxRequest) |
| { |
| Populate(); |
| } |
| } |
| private void Populate() |
| { |
| if (RadComboBox1.Items.Count == 0) |
| { |
| RadComboBox1.Items.Add(new RadComboBoxItem()); |
| } |
| RadTreeView ParenTreeView = (RadTreeView)RadComboBox1.Items[0].FindControl("RadTreeView1"); |
| ParenTreeView.LoadContentFile("TreeView.xml"); |
| } |
| protected void ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
| { |
| Populate(); |
| } |
| } |
| <?xml version="1.0" encoding="utf-8" ?> |
| <Tree> |
| <Node Text="Books" Expanded="True"> |
| <Node Text="Arts" /> |
| <Node Text="Biographies" /> |
| <Node Text="Children's Books" /> |
| <Node Text="Computers &amp; Internet" /> |
| <Node Text="Cooking" /> |
| <Node Text="History" /> |
| <Node Text="Fiction" /> |
| <Node Text="Mystery" /> |
| <Node Text="Nonfiction" /> |
| <Node Text="Romance" /> |
| <Node Text="Science Fiction " /> |
| <Node Text="Travel" /> |
| </Node> |
| <Node Text="Music"> |
| <Node Text="Alternative" /> |
| <Node Text="Blues" /> |
| <Node Text="Children's Music" /> |
| <Node Text="Classical" /> |
| <Node Text="Country" /> |
| <Node Text="Dance" /> |
| <Node Text="Folk " /> |
| <Node Text="Hard Rock" /> |
| <Node Text="Jazz" /> |
| <Node Text="R&amp;B" /> |
| <Node Text="Soundtracks" /> |
| </Node> |
| <Node Text="Movies"> |
| <Node Text="Action" /> |
| <Node Text="Animation" /> |
| <Node Text="Classics" /> |
| <Node Text="Comedy" /> |
| <Node Text="Documentary" /> |
| <Node Text="Drama" /> |
| <Node Text="Horror" /> |
| <Node Text="Musicals" /> |
| <Node Text="Mystery" /> |
| <Node Text="Westerns" /> |
| </Node> |
| <Node Text="Software"> |
| <Node Text="Business &amp; Office" /> |
| <Node Text="Database" /> |
| <Node Text="Networking" /> |
| <Node Text="Presentation" /> |
| <Node Text="Project Management" /> |
| <Node Text="Reports" /> |
| <Node Text="Spreadsheet" /> |
| <Node Text="Word Processing" /> |
| </Node> |
| </Tree> |
Hi
I am writing a web user control (ascx) that includes a RadEditor. This control is being added to a page on one of our Sharepoint sites.
I have got the control and the editor working, but I am not sure where to place the image files that we have created to be displayed on the custom buttons I hve added to the editor's toolbar.
The directory structure on the Sharepoint Web Front end is currently set up like this:
Inetpub
...wwwroot
......wss
.........VirtualDirectories
............80
...............App_Data
..................RadSpell (contains the editor dictionary files)
...............App_GlobalResources (contains the editor resx files)
...............EditorSetupFiles (this is where I have added our toolsfile.xml and the custom icon .gif files)
The .ascx file is stored in Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES\myCustomControls on the same web front end server. It contains the following code:
<%@ Control Language="vb" ClassName="RadTest" %>
' include files here
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI"
Assembly="Telerik.Web.UI, Version=2008.2.723.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<style type="text/css">
.rade_toolbar.Default .InsertAbbr
{
background-image: url(~/EditorSetupFilesT/icon_abbreviation.gif);
}
.rade_toolbar.Default .InsertBlockQuote
{
background-image: url(~/EditorSetupFiles/icon_blockquote.gif);
}
.rade_toolbar.Default .InsertQuote
{
background-image: url(~/EditorSetupFiles/icon_quote.gif);
}
</style>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
litEditCharges.Text = "You can edit charges here..."
myEditor.content = "center centre some text here"
End Sub
</script>
<asp:ScriptManager runat="server" ID="ScriptManager1" />
<asp:Literal runat="server" ID="litEditCharges"></asp:Literal>
<telerik:RadEditor Runat="server" id="myEditor" ToolsFile="~/EditorSetupFiles/ToolsFile.xml" Language="en-GB" EditModes="Design, Html" SpellCheckSettings-DictionaryLanguage="en-gb" >
<Tools>
<telerik:EditorToolGroup >
<telerik:EditorTool Name="InsertAbbr" Text="Insert Abbreviation" />
<telerik:EditorTool Name="InsertBlockQuote" Text="Insert Block Quote" />
<telerik:EditorTool Name="InsertQuote" Text="Insert Quote" />
</telerik:EditorToolGroup>
</Tools>
</telerik:RadEditor>
<script type="text/javascript">
//<![CDATA[
Telerik.Web.UI.Editor.CommandList["InsertAbbr"] = function(commandName, editor, args)
{
//javascript code for function
}
};
Telerik.Web.UI.Editor.CommandList["InsertBlockQuote"] =
function CustomDialogCommand(commandName, editor, oTool)
{
//javascript code for function
};
Telerik.Web.UI.Editor.CommandList["InsertQuote"] =
function CustomDialogCommand(commandName, editor, oTool)
{
//javascript code for function
};
//]]>
</script>
Using this the icons show up completely blank. If I change the name of the skin in the css declaration the button has a (!) icon, so I think the problem is that the icon files are in a directory that cannot be read.
Thanks for any help
Peter



| Sub ChannelsList_InsertCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles ChannelsList.InsertCommand |
| If Not e.Canceled Then |
| Dim editedRow As GridEditableItem = CType(e.Item, GridEditableItem) |
| Dim channelEditor As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl) |
| Dim channelsFile As ChnFile = CType(Session("ChannelsFile"), ChnFile) |
| Dim channel As New Channel() |
| With channel |
| .Name = CType(editedRow.FindControl("tbxDisplayName"), RadTextBox).Text |
| .Phonetic = CType(editedRow.FindControl("tbxPhonetic"), RadTextBox).Text |
| .Comment = CType(editedRow.FindControl("tbxComment"), RadTextBox).Text |
| End With |
| End If |
| End Sub |