2

I am trying to develop WPF application. I want to have Table inside table structure. So i have used XamDataGrid and in the field, i am using CellValuePresenter to display another table inside that cell.

The code for Parent data grid

<igDP:XamDataGrid Height="Auto" ScrollViewer.VerticalScrollBarVisibility="Hidden" Theme="Office2010Blue" DataSource="{Binding ParameterList}"  AutoFit="True"  BorderBrush="DarkGray" BorderThickness="0.8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  GroupByAreaLocation="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" >
     <igDP:XamDataGrid.FieldLayouts>
      <igDP:FieldLayout>
          <igDP:FieldLayout.Fields>
              <igDP:Field Name="PARAMETER">
                  <igDP:Field.Settings>
                      <igDP:FieldSettings AllowEdit="False" />
                  </igDP:Field.Settings>
              </igDP:Field>
              <igDP:Field Name="VALUE">
                  <igDP:Field.Settings>
                      <igDP:FieldSettings AllowEdit="False"  CellValuePresenterStyle="{StaticResource downloadFileBtnStyle}" />
                  </igDP:Field.Settings>
              </igDP:Field>               
 </igDP:FieldLayout.Fields>
</igDP:XamDataGrid>

I want to have another table inside the VALUE field.

so my style looks like this

 <Style TargetType="{x:Type igDP:CellValuePresenter}"   x:Key="downloadFileBtnStyle">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=DataItem.TABLE_DATATYPE}"  Value="True">
                <Setter Property ="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <Grid>
                                <igDP:XamDataGrid  x:Name="Subtbl"  VerticalAlignment="Center"    DataSource="{ Binding Path = ParameterList/TABLEDATA}"  Height="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible" Theme="Office2010Blue"  AutoFit="True"  BorderBrush="DarkGray" BorderThickness="0.8" HorizontalAlignment="Stretch"   GroupByAreaLocation="None" ScrollViewer.HorizontalScrollBarVisibility="Visible" >
                                    <ContentPresenter Content="{TemplateBinding Content}"/>
                                </igDP:XamDataGrid>
                            </Grid>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>

In the output i am getting parent table correctly and for the child table inside the VALUE field only values of the child table are displayed. like this

enter image description here

I am Wondering why there are no table and cell borders inside the cell of parent XamDataGrid.

Parent XamDataGrid is bound to observable collection called ParameterList and child XamDataGrid is bound datatable called TableData.

Is it the issue with the content presenter?

sampat nayak
  • 123
  • 2
  • 12

0 Answers0