
<
telerik:RadTreeView ID="rtMailingList" ShowLineImages="false" runat="server" CausesValidation="false">
<Nodes>
<telerik:RadTreeNode Text="Mailing Lists" Value="ML" ContextMenuID="null" PostBack="false"/>
</Nodes>
</telerik:RadTreeView>
I'm trying to override the base styles and use a min height -but I can't get all the nodes to min size and when I hover over a node my hover style applies but I jump all over the place.. Here are my styles.
.RadTreeView,
.RadTreeView a.rtIn,
.RadTreeView .rtEdit .rtIn .rtSp .rtLI input
{
display:block;
border-width: 0 0 1px 0;
border-style:dotted;
border-color:#e6e6e6;
color: #a22f01;
min-height:20px;
padding:5px 5px 0 5px;
}
.RadTreeView .rtSelected .rtIn
{
display:block;
border-width: 0 0 1px 0;
border-style:dotted;
background-color: #a22f01;
background-color:#ffad38;
min-height:20px;
padding:5px 5px 0 5px;
color:#fff;
background:#a22f01 url(/images2/arrow.png) right no-repeat;
}
.RadTreeView .rtHover .rtIn
{
display:block;
border-width: 0 0 1px 0;
border-style:dotted;
border-color:#e6e6e6;
color: #a22f01;
background-color:#ffad38;
min-height:20px;
padding:5px 5px 0 5px;
}
| public class RadEditorWrapper : WebControl, ITextEditor, ITextControl |
| { |
| private Dictionary<string, string> configOptions = new Dictionary<string, string>(); |
| private bool _enableHtmlModeEditing = true; |
| private static bool smAdded = false; |
| private RadEditor editor; |
| private ScriptManager scriptManager; |
| #region ITextEditor Members |
| public void ApplyConfigurationOption(string name, string value) |
| { |
| //Save config options |
| if (configOptions.ContainsKey(name)) |
| configOptions[name] = value; |
| else |
| configOptions.Add(name, value); |
| //Try to set control properties |
| Type t = editor.GetType(); |
| System.Reflection.PropertyInfo pi = t.GetProperty(name); |
| if (pi != null) |
| { |
| if (pi.PropertyType == typeof(string)) |
| { |
| pi.SetValue(editor, value, null); |
| } |
| else if (pi.PropertyType == typeof(int)) |
| { |
| pi.SetValue(editor, int.Parse(value), null); |
| } |
| } |
| } |
| public int Columns |
| { |
| get |
| { |
| return 80; |
| } |
| set |
| { |
| } |
| } |
| public bool EnableHtmlModeEditing |
| { |
| get |
| { |
| return this._enableHtmlModeEditing; |
| } |
| set |
| { |
| this._enableHtmlModeEditing = value; |
| } |
| } |
| public string GetBookmarkScript() |
| { |
| return ""; |
| } |
| public string GetContentInsertScript(string contentVariableName) |
| { |
| return string.Format("$find(\"<%={1}%>\").pasteHtml('{0}');", contentVariableName, this.ClientID); |
| } |
| public string GetContentScript() |
| { |
| return string.Format("$find(\"<%={0}%>\").get_Html(true);", this.ClientID); |
| } |
| public string GetContentUpdateScript(string contentVariableName) |
| { |
| return string.Format("$find(\"<%={1}%>\").set_Html('{0}');", contentVariableName, this.ClientID); |
| } |
| public string GetFocusScript() |
| { |
| return string.Format("$find(\"<%={0}%>\").setFocus();", this.ClientID); |
| } |
| public bool IsSupported(System.Web.HttpBrowserCapabilities browser) |
| { |
| return true; |
| } |
| public bool IsRichTextCapable |
| { |
| get { return true; } |
| } |
| public int Rows |
| { |
| get |
| { |
| return 20; |
| } |
| set |
| { |
| } |
| } |
| #endregion |
| #region ITextControl Members |
| public string Text |
| { |
| get |
| { |
| return editor != null ? editor.Content : string.Empty; |
| } |
| set |
| { |
| if (editor != null) |
| editor.Content = value; |
| } |
| } |
| #endregion |
| public RadEditorWrapper() |
| { |
| editor = CreateRadEditor(); |
| editor.ID = "RadEditor"; |
| scriptManager = new ScriptManager(); |
| scriptManager.EnablePartialRendering = true; |
| scriptManager.ID = "RadEditorScriptManager"; |
| } |
| protected override void CreateChildControls() |
| { |
| if (!smAdded) |
| { |
| this.Controls.Add(scriptManager); |
| smAdded = true; |
| } |
| this.Controls.Add(editor); |
| } |
| protected override void OnUnload(EventArgs e) |
| { |
| smAdded = false; |
| base.OnUnload(e); |
| } |
| private RadEditor CreateRadEditor() |
| { |
| RadEditor editor = new RadEditor(); |
| editor.Modules.Clear(); |
| //DialogDefinition insertEmoticonDialogDefinition = new DialogDefinition("~/EmoticonsDialog.ascx", new DialogParameters()); |
| //insertEmoticonDialogDefinition.Modal = true; |
| //insertEmoticonDialogDefinition.VisibleTitlebar = true; |
| //insertEmoticonDialogDefinition.VisibleStatusbar = false; |
| //insertEmoticonDialogDefinition.Width = Unit.Pixel(250); |
| //insertEmoticonDialogDefinition.Height = Unit.Pixel(250); |
| //editor.AddDialogDefinition("Emoticons", insertEmoticonDialogDefinition); |
| InitToolbar(editor); |
| SetImageManagerProps(editor); |
| return editor; |
| } |
| private void SetImageManagerProps(RadEditor editor) |
| { |
| string baseVirtualPath = "~/UserImages"; |
| string cuurentUserName = CurrentUserName.LastIndexOf('\\') < 0 ? CurrentUserName : CurrentUserName.Substring(CurrentUserName.LastIndexOf('\\') + 1); |
| if (!IsMember) |
| return; |
| string basePath = HttpContext.Current.Server.MapPath(baseVirtualPath); |
| string userPath = string.Format("{0}\\{1}", basePath, cuurentUserName); |
| string userVirtualPath = string.Format("{0}/{1}", baseVirtualPath, cuurentUserName); |
| if (!Directory.Exists(basePath)) |
| Directory.CreateDirectory(basePath); |
| if (!Directory.Exists(userPath)) |
| Directory.CreateDirectory(userPath); |
| editor.ImageManager.UploadPaths = new string[] { userVirtualPath }; |
| editor.ImageManager.ViewPaths = new string[] { userVirtualPath }; |
| editor.ImageManager.MaxUploadFileSize = 5242880; // 5 Mb |
| } |
| private void InitToolbar(RadEditor editor) |
| { |
| EditorToolGroup group = new EditorToolGroup(); |
| group.Tools.Add(new EditorTool("Bold")); |
| group.Tools.Add(new EditorTool("Underline")); |
| group.Tools.Add(new EditorTool("Italic")); |
| group.Tools.Add(new EditorSeparator()); |
| group.Tools.Add(new EditorTool("JustifyLeft")); |
| group.Tools.Add(new EditorTool("JustifyCenter")); |
| group.Tools.Add(new EditorTool("JustifyRight")); |
| group.Tools.Add(new EditorTool("JustifyFull")); |
| group.Tools.Add(new EditorTool("JustifyNone")); |
| group.Tools.Add(new EditorSeparator()); |
| group.Tools.Add(new EditorTool("ForeColor")); |
| group.Tools.Add(new EditorTool("BackColor")); |
| group.Tools.Add(new EditorSeparator()); |
| if (IsMember) |
| { |
| group.Tools.Add(new EditorTool("ImageManager")); |
| group.Tools.Add(new EditorSeparator()); |
| } |
| group.Tools.Add(new EditorTool("InsertOrderedList")); |
| group.Tools.Add(new EditorTool("InsertUnorderedList")); |
| group.Tools.Add(new EditorTool("InsertSymbol")); |
| group.Tools.Add(new EditorTool("InsertHorizontalRule")); |
| group.Tools.Add(new EditorSeparator()); |
| group.Tools.Add(new EditorTool("LinkManager")); |
| group.Tools.Add(new EditorTool("Unlink")); |
| group.Tools.Add(new EditorSeparator()); |
| group.Tools.Add(new EditorTool("AjaxSpellCheck")); |
| //EditorTool emoticons = new EditorTool("Emoticons"); |
| //emoticons.ShowIcon = true; |
| //group.Tools.Add(emoticons); |
| editor.Tools.Clear(); |
| editor.Tools.Add(group); |
| } |
| private bool IsMember |
| { |
| get |
| { |
| return true; |
| //return Roles.IsUserInRole("Members"); |
| } |
| } |
| private string CurrentUserName |
| { |
| get { return HttpContext.Current.User.Identity.Name; } |
| } |
| } |