Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a WPF richtextbox having Table a as Flowdocument. I need to copy content of selected table rows using C# on mouse right click.

The problem I m facing is being unable to get selected rows.

Using following function but unable to get selected rows of Richtextbox.

Any help would be appreciated.

Thanks in advance

C#
public static List<TableRow> GetSelectedParagraphs(FlowDocument document, TextSelection selection)
    {
        return document.Blocks.OfType<TableRow>().Where(w => selection.Contains(w.ContentStart)).ToList();
    }
Posted
Updated 10-Sep-14 4:59am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900