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

how to add datagrid to radbookitem

2 Answers 22 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, 02:51 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.
Is it even possible?

Thanks a lot.

2 Answers, 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.

All the best,
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.
0
shweta singhal
Top achievements
Rank 1
answered on 19 Apr 2010, 01:52 PM
thanks a lot. it works!
Tags
Book
Asked by
shweta singhal
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
shweta singhal
Top achievements
Rank 1
Share this question
or