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

adding datagrid to radbookitem

1 Answer 47 Views
Book
This is a migrated thread and some comments may be shown as answers.
shweta singhal
Top achievements
Rank 1
shweta singhal asked on 16 Apr 2010, 03:30 PM
Hi,

I am adding radbookitem to a radbook dynamically. On some of radbookitem i want to add a datagrid. How can I add datagrid to radbookitem.

Thanks a lot.

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 19 Apr 2010, 12:51 PM
Hi Shweta,

Yes, you can add a DataGrid to a RadBookItem. RadBookItem is a ContentControl, therefore you can put anything as its content.

for (int i = 0; i < 10; i++)
{
    // Create BookItem
    RadBookItem bookItem = new RadBookItem();
    // Create GridView
    RadGridView grid = new RadGridView();
    // Bind the GridView to a collection of items
    grid.ItemsSource = this.GenerateGridViewItemsSource();
    // Pass the GridView as a content to the BookItem
    bookItem.Content = grid;
    // Add the BookItem as an item to the items collection of the Book
    this.book1.Items.Add(bookItem);
}

Let me know if this helps. If you have additional questions or comments, let me know. I'd be glad to further assist you.

Sincerely yours,
Kiril Stanoev
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
Book
Asked by
shweta singhal
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or