Chapters and bindings

5 posts, 0 answers
  1. prog1
    prog1 avatar
    61 posts
    Member since:
    Jul 2008

    Posted 03 Aug 2010 Link to this post

    Is there a way to add chapters to the RadBook? A workaround would be a RadTab with RadBooks for each chapter.
    Is this the recommanded way?

    If I want to bind the RadBook to a list of objects, is it possible that ervery object is represented by 2 RadBookItems (left & right page).
    Do you have examples for binding and RadBook? Not tried, yet.

    What I like to get is something like This:

    RadBook - Product catalog
    Chapter - product categories (The first 2 pages of a Chapter should describe the categorie, binding categories)
    2 Sites - product (Binding on the product collection of categorie).
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 06 Aug 2010 Link to this post

    Hello Fabian Höger,

    The RadBook can only be bound to a flat collection of items. If you want a hierarchy, then indeed you may want to use something as a TabControl + RadBook.

    Another option is to flatten your hierarchy before binding it to the RadBook and use the categories / chapters in a control (like a TreeView) that will act as "contents".

    In these examples the book control is databound:

    http://demos.telerik.com/silverlight/#Book/Performance

    http://demos.telerik.com/silverlight/#Book/Binding

    All the best,
    Miroslav
    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
  3. DevCraft banner
  4. prog1
    prog1 avatar
    61 posts
    Member since:
    Jul 2008

    Posted 10 Aug 2010 Link to this post

    Isn't there a way, that one item is represented by 2 Pages?
    Do this by code and set every PageItem his own Datacontext?
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 10 Aug 2010 Link to this post

    Hi prog1,

    There is no easy way to represent one item by two pages, the RadBook is an ItemsControl and for each data item is created one control (RadBookItem) to represent it.

    I can suggest creating a ViewModel for the data that you want to represent where each original item that needs two pages is represented by two items.

    Best wishes,
    Miroslav
    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
  6. prog1
    prog1 avatar
    61 posts
    Member since:
    Jul 2008

    Posted 10 Aug 2010 Link to this post


    foreach
    (Question item in this.context.Questions)
                   {
                       RadBookItem leftItem = new RadBookItem();
                       leftItem.DataContext = item;
                       book.Items.Add(leftItem);
                       RadBookItem rightItem = new RadBookItem();
                       rightItem.DataContext = item;
                       book.Items.Add(rightItem);
                   }

    That what I'm doing now and it seems to work. VieModel would be an alternative.
    Thank you.
Back to Top
DevCraft banner