Hi Team,
Please refer to the attachment "Enter key and Shift + Enter keys behavior.png". Please refer to the steps, I followed
1) Typed "firstline in paragraph1"
2) Pressed ENTER Key (it creates a new Paragraph)
3) Typed "second line in paragraph2"
Actual Result : Pressing ENTER key creates a new paragraph, so we have extra line space
Expected Result : If we press ENTER key, Can we have next line in same paragraph (without line space)
4) Typed "para 3 abcd"
5) Pressed SHIFT key + ENTER key
6) Typed "efgh"
Actual Result : Pressing SHIFT key + ENTER key creates a next line in same paragraph.
Expected Result : If we press SHIFT key + ENTER key, Can we have next line in NEW paragraph
I have tried the below approaches however no luck.
void utdRichTextEditor_PreviewEditorKeyDown(object sender, PreviewEditorKeyEventArgs e)
{
if ((Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
&&
Keyboard.IsKeyDown(Key.Enter))
{
e.SuppressDefaultAction = true;
}
else if (Keyboard.IsKeyDown(Key.Enter))
{
e.SuppressDefaultAction = true;
((RadRichTextBox)sender).InsertLineBreak();
}
}
private void SetLineSpacing()
{
myRadRichTextBox.Document.LineSpacingType = LineSpacingType.Exact;
myRadRichTextBox.DocumentInheritsDefaultStyleSettings = true;
myRadRichTextBox.Document.LineSpacing = 0;
myRadRichTextBox.Document.ParagraphDefaultSpacingAfter = 0;
myRadRichTextBox.Document.ParagraphDefaultSpacingBefore = 0;
}
Thanks,
Obuliraj Ramalingam
Please refer to the attachment "Enter key and Shift + Enter keys behavior.png". Please refer to the steps, I followed
1) Typed "firstline in paragraph1"
2) Pressed ENTER Key (it creates a new Paragraph)
3) Typed "second line in paragraph2"
Actual Result : Pressing ENTER key creates a new paragraph, so we have extra line space
Expected Result : If we press ENTER key, Can we have next line in same paragraph (without line space)
4) Typed "para 3 abcd"
5) Pressed SHIFT key + ENTER key
6) Typed "efgh"
Actual Result : Pressing SHIFT key + ENTER key creates a next line in same paragraph.
Expected Result : If we press SHIFT key + ENTER key, Can we have next line in NEW paragraph
I have tried the below approaches however no luck.
void utdRichTextEditor_PreviewEditorKeyDown(object sender, PreviewEditorKeyEventArgs e)
{
if ((Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
&&
Keyboard.IsKeyDown(Key.Enter))
{
e.SuppressDefaultAction = true;
}
else if (Keyboard.IsKeyDown(Key.Enter))
{
e.SuppressDefaultAction = true;
((RadRichTextBox)sender).InsertLineBreak();
}
}
private void SetLineSpacing()
{
myRadRichTextBox.Document.LineSpacingType = LineSpacingType.Exact;
myRadRichTextBox.DocumentInheritsDefaultStyleSettings = true;
myRadRichTextBox.Document.LineSpacing = 0;
myRadRichTextBox.Document.ParagraphDefaultSpacingAfter = 0;
myRadRichTextBox.Document.ParagraphDefaultSpacingBefore = 0;
}
Thanks,
Obuliraj Ramalingam