Hello,
I want to center an element on a cell of an array.
How I can select it on CharacterSettings ?
Regards
Hello teamtim,
Thank you for your post.
I'm a little bit unsure of what you mean by "center an element on a cell of an array". Being that this forum thread came in under the XamRichTextEditor and you are mentioning cells, I am under the impression that you are using a table in your rich text editor and you wish to center the content of one of the cells. Please correct me if I am wrong, as the following goes off of that impression.
The character settings of the XamRichTextEditor is not going to be of much help here, to be honest. What you should look into is ParagraphSettings that you can apply to the ParagraphNode that holds the content of your cell. The ParagraphSettings object has a ParagraphAlignment property for horizontal alignment, and a TextAlignment property for vertical alignment. If you set these, and then apply them to your ParagraphNode.Settings property, I believe you will achieve the functionality you are looking for.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for your help and sorry for my mistake.
I share my code, just in case someone will need it :
tcn = trn.ChildNodes[1] as TableCellNode; tcn.Settings = rowCounter % 2 != 0 ? rowAlternatingSettings : rowSettings; pn = tcn.ChildNodes[0] as ParagraphNode; pn.Settings = new ParagraphSettings { TextAlignment = ParagraphTextAlignment.Center, ParagraphAlignment = ParagraphAlignment.Center }; pn.ChildNodes.Add( CreateRunNodeWithContent( charSettings, "Value"));