XMLFoldingTagger is not documented. Neither here: https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/taggers/overview nor here: https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/taggers/folding-taggers.
When using the new Office 2019 Light theme in the SyntaxEditor there are no scrollbars displayed in the CompletionList window. Also the list is not scrollable using the scrollwheel. Only when using the arrows on the keyboard.
When using the fluent theme it is working fine.
See attached screenshots.
The component itself seems to work fine with DPI scaling except for the search/find functionality. When you search for some text and click to go to the first instance it finds, the actual text is off-screen, though it is highlighted correctly (when you scroll down you can see it highlighted).
This is easy to replicate by changing the Windows display scale to anything other than 100%.
Use the following code in the project:
Private Sub btnToggleWW_Click(sender As Object, e As EventArgs) Handles btnToggleWW.Click
RadSyntaxEditor1.IsWordWrapEnabled = Not RadSyntaxEditor1.IsWordWrapEnabled
Me.Text = RadSyntaxEditor1.IsWordWrapEnabled.ToString()
End SubWhen you enable the word wrapping, the horizontal scrollbar is collapsed:
However, when the word wrapping is disabled, the scrollbar doesn't reappear anymore:
This is an odd one - see attached GIF.
If I attempt to select characters with the mouse (left-click + drag), at the beginning of any line of text, it won't highlight (90+% of the time). That's if I'm dragging from left-to-right.
If I select the same text from right-to-left, it works every time.
Setting the SyntaxEditorElement.IsReadOnly property to true disables editing the text inside RadSyntaxEditor. However, when opening the Find and Replace dialog, the user is still allowed to replace the text and thus change the content in the document. This shouldn't be allowed when the control is in read-only mode.
Workaround:
this.radSyntaxEditor1.SyntaxEditorElement.InputHandler = new MyInputBehavior(this.radSyntaxEditor1.SyntaxEditorElement);
public class MyInputBehavior : SyntaxEditorInputBehavior
{
public MyInputBehavior(RadSyntaxEditorElement editor) : base(editor)
{
}
protected override void PerformOpenFileDialog(KeyEventArgs e)
{
this.SyntaxEditor.SearchPanel.ReplaceAllButton.Enabled = false;
this.SyntaxEditor.SearchPanel.ReplaceButton.Enabled = false;
this.SyntaxEditor.SearchPanel.ReplaceTextBox.Enabled = false;
base.PerformOpenFileDialog(e);
}
}
When I setup and OverloadList, the OverloadListWindow follows the cursor and can move off screen so the user can't see/read the information that is presented.
Workaround: adjust the position of the overload window when it is shown:
this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.VisibleChanged+=OverloadListWindow_VisibleChanged;
private void OverloadListWindow_VisibleChanged(object sender, EventArgs e)
{
ShapedForm f = sender as ShapedForm;
Screen myScreen = Screen.FromControl(this);
Rectangle area = myScreen.WorkingArea;
if (f.Left + f.Width > area.Width)
{
f.Left = area.Width - f.Width -5;
}
}
Change the NumbersColor at design time:
Run the application:
Workaround: move this code in the Form.Load event
If my xml string contains an element with attributes, XMLFoldingTagger just ignores it!
For example:
<Formular DebugMode="F" Version="1" Typ="Rechnung">
<OtherElements/>
<Formular/>
is ignored. Element Formular is not recognized by the XMLFoldingTagger. Only simple elements are recognized, like:
<Formular>
<OtherElements/>
<Formular/>
Please refer to the attached gif file.
Workaround: set bottom padding by setting the SyntaxEditorElement.HorizontalScrollBar.Padding property.
mySyntaxEditor1.SyntaxEditorElement.HorizontalScrollBar.Padding = new Padding(0, 0, 0, 2);
XmlFoldingTagger throws while entering XML. When closing the root tag on the next line, the Tagger throws once you enter the '/' (before.png -> after.png).
Adding a second opening tag and converting it to closing by inserting the '/' afterwards works.
When adding a child tag, the tagger offers to fold the unfinished tag against the root closing tag, and throws if you try to do so.
using System;using System.Windows.Forms;using Telerik.WinForms.Controls.SyntaxEditor.UI;using Telerik.WinForms.Controls.SyntaxEditor.UI.IntelliPrompt.Overloading;namespace WindowsFormsApp1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); OverloadInfoCollection overloadListA = new OverloadInfoCollection { new OverloadInfo("aaa", "aaa description") }; this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Presenter.OverloadListItems = overloadListA; } private void btnClear_Click(object sender, EventArgs e) { this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Presenter.OverloadListItems.Clear(); } private void btnChange_Click(object sender, EventArgs e) { OverloadInfoCollection overloadListB = new OverloadInfoCollection { new OverloadInfo("bbb", "bbb description") }; OverloadListPopup overloadListWindow = this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow; overloadListWindow.Presenter.OverloadListItems = overloadListB; overloadListWindow.Refresh(); } private void radButton1_Click(object sender, EventArgs e) { OverloadInfoCollection overloadListC = new OverloadInfoCollection { new OverloadInfo("ccc", "ccc description"), new OverloadInfo("ccc 1", "ccc 1 description") }; this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Presenter.OverloadListItems = overloadListC; } private void radSyntaxEditor1_DocumentContentChanged(object sender, Telerik.WinForms.SyntaxEditor.Core.Text.TextContentChangedEventArgs e) { this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Show(); } }}Hi Team , I want to make my syntax editor readonly and user should not be able to make any changes.
I have made my
((Telerik.WinControls.UI.RadSyntaxEditorElement)(this.radSyntaxEditor.GetChildAt(0))).IsReadOnly = true; .
But still the user is able to delete the data by pressing delete button .
How can we restrict this.
I also tried radSyntaxEditor.enabled=false. It disables editing but the are is greyed out.
Thanks
A programmatically created selection keeps highlighting the following part of the text when its original content is deleted via keyboard.
If there are less characters left than the selection encompassed, further editing will result in unhandled Exceptions.
Steps to reproduce: