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

External RowDetails

1 Answer 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
steve
Top achievements
Rank 1
steve asked on 14 Sep 2011, 07:14 PM
Hello all.

I'm trying to display rowdetails in a nice tabcontrol.
I can display the rowdetails without any flaw using this method, but only if my grid is not wrapped in a tabcontrol:

XAML

<telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate x:Name="TrackGrid">
                      <telerik:RadGridView Name="innerGrid"></telerik:RadGridView>
                </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>

Code

Dim club As New .Album
club = TryCast(RadGridView1.SelectedItem, Album)
 
Dim innerDataGrid As RadGridView = TryCast(e.DetailsElement, RadGridView)
innerDataGrid.ItemsSource = Track.GetAll(club.AlbumID)

As i work in VB, and i'm just switching  to WPF, i can't seem to find some decent exaples how to do this action while using a tabcontrol in my rowdetails. So what i need is to wrap my grid in a radtabcontrol, and then get the same output, in a tab, like this

<telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate x:Name="TrackGrid">
                    <telerik:RadTabControl>
                        <telerik:RadTabItem>
                           <telerik:RadGridView Name="innerGrid"></telerik:RadGridView>
                        </telerik:RadTabItem>
                    </telerik:RadTabControl> 
                </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>

I'm looking towards your answer to this.

Greetings

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 20 Sep 2011, 09:48 AM
Hello Steve,

 The RowDetails are not displayed as you do not set the ItemsSource of the GridView. As I see from your code you cast the e.DetailsElement to a RadGridView. The result is null, as the e.DetailsElement is a TabControl, not a RadGridView.

In order to get the RadGridView, you could access it like so:

DirectCast(DirectCast(DirectCast(e.DetailsElement, Telerik.Windows.Controls.RadTabControl).Items(0), Telerik.Windows.Controls.RadTabItem).Content, Telerik.Windows.Controls.RadGridView).ItemsSource = Track.GetAll(club.AlbumID)

Could you please check this and share if it is what are you looking for?

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
steve
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or