Declined
Last Updated: 22 Feb 2017 12:33 by ADMIN
ADMIN
Mihail
Created on: 12 Oct 2015 12:11
Category: UI for WPF
Type: Bug Report
0
Moved to TDP: Cloning document containing fields without Separator causes NullReferenceException
Workaround:

private static void WorkaroundFieldsIssue(RadFlowDocument flowdocument)
{
    foreach (FieldCharacter fieldCharacter in flowdocument.EnumerateChildrenOfType<FieldCharacter>().ToList())
    {
        // only for start
        if (fieldCharacter.FieldCharacterType == FieldCharacterType.Start)
        {
            if (fieldCharacter.FieldInfo.Separator != null && fieldCharacter.FieldInfo.Separator.Parent == null)
            {
                Paragraph parent = fieldCharacter.FieldInfo.End.Paragraph;
                int index = parent.Inlines.IndexOf(fieldCharacter.FieldInfo.End);

                fieldCharacter.FieldInfo.End.Paragraph.Inlines.Insert(index, fieldCharacter.FieldInfo.Separator);
            }
        }
    }
}
This item is migrated to the Telerik Document Processing portal: 
http://feedback.telerik.com/Project/184/Feedback/Details/190083 
Please use the new item for commenting, voting and subscribing instead of this one.
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments