This is a migrated thread and some comments may be shown as answers.

binding to IEnumerable<RadDocument>

1 Answer 71 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ingemar
Top achievements
Rank 1
Ingemar asked on 17 Jul 2010, 05:20 PM
Hi,

I am trying to use a binding in the following code. Using a List<string> in the TextBlock works but using a List<RadDocument> in RadRichTextBox does not. Why is it so  and what should I do?  

<Grid>
    <Grid.Resources>
        <DataTemplate x:Name="LeftPageTemplate">
            <telerikDocuments:RadRichTextBox Document="{Binding}"/>
            <!--<TextBlock Text="{Binding}"/>-->
        </DataTemplate>
        <DataTemplate x:Name="RightPageTemplate"/>                  
    </Grid.Resources>
    <telerikNavigation:RadBook 
        ItemsSource="{Binding ListOfRadDocuments}"
        LeftPageTemplate="{StaticResource LeftPageTemplate}"
        RightPageTemplate="{StaticResource RightPageTemplate}"/>
</Grid>


The general question is: How do I bind the content of a RadRichTextBox in a RadBook to an IEnumerable<RadDocument> itemsource.
 
Another question is: What is currently the smartest way to present a RadDocument in a RadBook i.e. assuming a RadDocument with page breaks where the different pages in the RadDocument should map to the corresponding pages in a RadBook?

Best regards,
//Ingemar

1 Answer, 1 is accepted

Sort by
0
Accepted
Mike
Telerik team
answered on 20 Jul 2010, 12:43 PM
Hi Ingemar,

Displaying document content in Pages (document paging) is one of the most complex tasks of RadDocument and RadRichTextBox therefore it would be very difficult for you to simulate it to make it work in RadBook. We are currently working on a demo (as I mentioned in the other forum post) that will use different approach and some new custom controls that will present only a single page from a document. I'll let you know when these custom controls and demo are ready.

However binding of the Document property will not work since it is not a dependency property. We will consider changing this in the next version.

All the best,
Mike
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Ingemar
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or