Gridview RowDetailsTemplate

1 posts, 0 answers
  1. Li
    Li avatar
    2 posts
    Member since:
    Feb 2013

    Posted 21 Feb 2013 Link to this post

    Hi,
    I copy MyDataRow.cs and MyModel.cs (GridView Various Data Source - Demo) to my project.
    Data in Telerik:RadGridView.Columns show correctly but data in Telerik:RadGridView.RowDetailsTemplate is blank.
    Please advise me how to show it correctly. 
    Thanks.

    Below is my code.
    <UserControl.Resources>
            <local:MyModel x:Key="model"></local:MyModel>
        </UserControl.Resources>
     
        <Grid x:Name="LayoutRoot">
            <Telerik:RadGridView x:Name="grid1"
                                  telerik:StyleManager.Theme="Windows8"
                                  GroupRenderMode="Flat"
                                  RowIndicatorVisibility="Collapsed"
                                  IsReadOnly="True"
                                  Width="850"
                                  MinHeight="300"
                                  MaxHeight="500"
                                  AutoGenerateColumns="False"
                                  CanUserFreezeColumns="False"
                                  CanUserResizeColumns="False"
                                  Grid.ColumnSpan="2"
                                  ShowGroupPanel="False"
                                  ItemsSource="{Binding Data, Source={StaticResource model}}">
                <Telerik:RadGridView.Columns>
                    <Telerik:GridViewToggleRowDetailsColumn />
                    <Telerik:GridViewDataColumn Header="Transaction Date" Width="*" DataMemberBinding="{Binding Date}" UniqueName="TransactionDate"/>
                    <Telerik:GridViewDataColumn Header="Transaction Type" Width="*" DataMemberBinding="{Binding Src}" UniqueName="TransactionType"/>
                    <Telerik:GridViewDataColumn Header="Income Category" Width="*" DataMemberBinding="{Binding Cat}" UniqueName="Income Category"/>
                    <Telerik:GridViewDataColumn Header="Description" Width="200" DataMemberBinding="{Binding Description}" UniqueName="Description"/>
                    <Telerik:GridViewDataColumn Header="Transaction Amount" Width="*" DataMemberBinding="{Binding Transaction_Amount}" UniqueName="Amount"/>
                    <Telerik:GridViewDataColumn Header="Open Amount" Width="*" DataMemberBinding="{Binding Open_Amt}" UniqueName="OpenAmount"/>
                </Telerik:RadGridView.Columns>
                <Telerik:RadGridView.RowDetailsTemplate>
                    <DataTemplate>
                        <Telerik:RadTabControl x:Name="RadTabControl1" telerik:StyleManager.Theme="Windows8"
                                               Width="800"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center"
                                               Margin="0,20,0,20">
                            <Telerik:RadTabItem Header="Details"
                                                Margin="0,0,0,0"
                                                Height="24">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="Invoice No: "
                                               Margin="10,5,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="0"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding Invoice}"
                                               Margin="10,5,0,0"
                                               Foreground="Black"
                                               Grid.Row="0"
                                               Grid.Column="2">
                                    </TextBlock>
                                    <TextBlock Text="Receipt No: "
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="1"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding Receipt_Descriptor}"
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               Grid.Row="1"
                                               Grid.Column="2">
                                    </TextBlock>
                                    <TextBlock Text="Batch No: "
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="2"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding BatchID}"
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               Grid.Row="2"
                                               Grid.Column="2">
                                    </TextBlock>
                                    <TextBlock Text="Currency Code: "
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="3"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding Entry_Currency}"
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               Grid.Row="3"
                                               Grid.Column="2">
                                    </TextBlock>
                                    <TextBlock Text="Income Category: "
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="4"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding Cat}"
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               Grid.Row="4"
                                               Grid.Column="2">
                                    </TextBlock>
                                    <TextBlock Text="Description: "
                                               Margin="10,0,0,0"
                                               Foreground="Black"
                                               FontWeight="Bold"
                                               Grid.Row="5"
                                               Grid.Column="1">
                                    </TextBlock>
                                    <TextBlock Text="{Binding Description}"
                                               Margin="10,0,0,10"
                                               Foreground="Black"
                                               Grid.Row="5"
                                               Grid.Column="2">
                                    </TextBlock>
                                </Grid>
                        </Telerik:RadTabControl>
                    </DataTemplate>
                </Telerik:RadGridView.RowDetailsTemplate>
            </Telerik:RadGridView>
        </Grid>
Back to Top