The default behavior of the UltraFormattedTextEditor setting the text-align style is not working as expected. Another user brought this up here: http://forums.infragistics.com/forums/p/8292/33024.aspx#33024 where Matt (IG?) suggested it works the same as Word, then sort of backed off of that when he found that you can text-align individual blocks of text rather than the entire document. Rather than dredge up that 4 year old post, I'm posting my concerns here.
This is most curious behavior of the control because the bold, italic, underline, back color, and font color all work on selected text so it not like the ability to do this is out of your reach. Also, as you can see:
It
Works
Here
This is an Infragistics control I'm typing in, isn't it??? The WinForms control should work the same as the Web control and wrap the paragraphs in <p></p> instead of </br>. Then it would work the same, and behave like expected.
Hello,
Could you please review the sample attached to this post and see if it meets your requirements.Please feel free to let me know if I misunderstood you or if you have any other questions.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Boris,
Sorry for the delay in responding, I didn't get an email notification when you posted the example code.
In your example, I am assuming that you typed the <p> tags and text-align styles directly in the code, correct? If so, yes, that does work. The problem is that I want the end user, who does not know how to code HTML, to be able to set the align via a toolbar that I implement. Since the Enter key is inserting <br/> instead of <p> using the EditInfo.ApplyStyle() in code applies the style to the entire text box and not just the current block. The problem is not the text-align style, it is the lack of <p> for blocks of code.
There is currently no UI available to the user that will create <p> tags. As you pointed out, the Enter key will use a </BR> tag.
What UI are you giving the users to align the text?
Perhaps you could alter your UI to create a <p> tag around the text the users want to align? The trickiest part of that would be determining the bounds that the <p> tag should encompass.
We've moved away from the point here. The issue is text-aligning a block of text instead of the entire control's text. Like Word, WordPad, and even this editor I'm typing in right now all do.
Computer Chip said:We've moved away from the point here.
Um... okay. I'm afraid you lost me, then. What's the point?
I was trying to suggest a solution to the issue you raised. What is it that you want?
I only brought up the <p> tags because I saw that is how this editor was separating blocks of text. The underlying formatting isn't the my problem, but is a possible solution. My problem is you get all or nothing with the text-align in your control while other editors and controls will do a block of text.
Well, I think you were right. The reason aligning text is affecting the entire content of the control is because the text is not broken up into paragraphs. The alignment affects a block of text and without any <p> tags, then entire contents of the control is one block. So the only way to align a part of the text would be to use <p> tags instead of <BR/> tags.
But there is currently no way to do that through the UI. So the only solution I can see here would be to create the <p> tags in code when you perform the alignment.
I suppose, in theory, we could add a property to make the control use <p> tags when the user uses the Enter key. But currently there is no way to do that.
I recommend that you Submit a feature request to Infragistics.