Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1635
FormattedTextEditor grid column
posted

I have an UltraGrid with a column that has its style =  FormattedTextEditor. I use combo boxes and button selections to populate the column with various text items that essentially define a formula. I'm trying to format it so that different pieces of the formula have different colors. I am using FormattedLinkEditor and am successful doing this as long as I'm appending the pieces sequentially. It save the current Value and appends the newly added formatted value. I'm having trouble inserting a formatted piece in the middle of the formula. I can do it with the text part but it loses the formatting. How do I break up the formatted value into a" part1" and "part2" and insert a new formatted part in between.

Thanks,

Ron

Parents
  • 469350
    Offline posted

    Hi Ron,

    I'm a little fuzzy on the problem. The way it works is that you assign the Value of the cell with a string of XML that contains the information including the formatting of the text. So in order to insert something into the middle, you would have to insert the appropriate text into the xml in between the appropriate tags.

    There's not enough information in your post for me to guess what you are doing, where you are inserting the text, or why you are losing the formatting. My best guess is that you are inserting the text at the wrong point and you are somehow ending up with corrupted XML.

    It seems to me that it would be a lot easier for you to simply rebuild the entire string sequentially rather than trying to modify the existing XML to do an insert. This might create a performance problem, of course, but only if your strings are pretty long.

Reply Children