I would like to be able to set the default action to single line spacing. I have found some code as follows that allows you to change the line spacing of a selection. This code wont work in my case because when the text editor is loaded there is no initial selection.
ParagraphSettings paragraphSettings = new ParagraphSettings();
ParagraphSpacingSettings paragraphSpacingSettings = new ParagraphSpacingSettings();
paragraphSettings.WordWrap = true;
paragraphSettings.Spacing = paragraphSpacingSettings;
paragraphSpacingSettings.LineSpacing = new LineSpacing(1);
string error;
_textEditor.Document.ApplyParagraphSettings(_textEditor.Selection.DocumentSpan, paragraphSettings, out error);
Hello Aaron,
When the editor is loaded with a new empty document or new paragraphs are added to some document the settings applied on the new content are the Document’s default settings. In order to apply LineSpacing of 1 line for all paragraphs in the document you need to set these spacing settings to the default ParagraphSettings of the RootNode’s DocumentSettings object as follows:
Editor.Document.RootNode.Settings = new DocumentSettings();
Editor.Document.RootNode.Settings.DefaultParagraphSettings = paragraphSettings;
In the attached sample application I’m using this approach to achieve your requirements.
Please, let me know if you need further assistance on the matter.
Using the attached solution with infragistics 14.2 dlls, it still has a double line spacing when typing and the only way to get single line spacing is to hold shift while pressing enter. Could it be a issue w/ the version of infragistics I am using?