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

RadButton not displaying in Nested Grid View

1 Answer 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 02 Aug 2013, 01:34 PM
I'm creating a nested grid view that is three levels deep. I have a parent and a child grid with the child grid containing a tab control with two additional grids. The grids and everything load properly, however the buttons in the tab items are never being displayed (Add Hedging Default and Add Tank Bottom).
Do you see anything wrong with the XAML that would prevent them from being displayed? I've removed the stack panel, tried other buttons, set the size explicitly, etc without any change. 

At this point I'm at a loss of where to go from here.

Thank you


<
Grid DataContext="{StaticResource VmTerminalConfiguration}" Name="rootWindow" >
     <Grid.Resources>
         <DataTemplate x:Key="ChildRowDetailsTemplate">
 
             <telerik:RadTabControl x:Name="tabControl" telerik:TouchManager.IsTouchHitTestVisible="False">
 
                 <telerik:RadTabItem Header="Hedging Defaults" Name="hedgingDefaultsTabItem">
                     <Grid x:Name="LayoutWhite" Background="White">
                         <Grid.RowDefinitions>
                             <RowDefinition Height="Auto" />
                             <RowDefinition Height="*" />
                         </Grid.RowDefinitions>
 
                         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                             <telerik:RadButton Content="Add New Hedging Default" Click="AddHedgingDefaultButton_Click" Width="150" Margin="0,0,5,0" />
                         </StackPanel>
 
 
                         <telerik:RadGridView Grid.Row="1" Name="hedgingDefaultRadGridView" GroupRenderMode="Flat"
                          ItemsSource="{Binding TerminalConfigurationHedgingDefaultVMs}"
                          Foreground="Black" Height="250" RowIndicatorVisibility="Collapsed"
                          AutoGenerateColumns="False" CanUserFreezeColumns="False" BorderThickness="0"
                          CanUserResizeColumns="False" ShowGroupPanel="False" BorderBrush="{x:Null}" Margin="0"
                          EditTriggers="CellClick" CellEditEnded="CellEditEnded">
                             <telerik:RadGridView.Resources>
                                 <Style x:Key="GridViewToggleButtonColumnStyle" TargetType="telerik:GridViewCell">
                                     <Setter Property="Padding" Value="0,0,0,0" />
                                 </Style>
                             </telerik:RadGridView.Resources>
                             <telerik:RadGridView.Columns>
 
                                 <telerik:GridViewComboBoxColumn Header="Product" DataMemberBinding="{Binding ParentCommodityID}"
                                             SelectedValueMemberPath="CommodityID" DisplayMemberPath="CommodityName" ItemsSource="{Binding AllParentCommodities,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbReceiptHedgingDefault" Header="Receipt" DataMemberBinding="{Binding ReceiptHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbOtherHedgingDefault" Header="Other" DataMemberBinding="{Binding OtherHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbScheduleHedgingDefault" Header="Schedule" DataMemberBinding="{Binding ScheduleHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewDataColumn Name="dpHedgingDefaultEffectiveDate" Header="Effective Date" DataMemberBinding="{Binding EffectiveDate, StringFormat=d, ValidatesOnDataErrors=True}" Width="150" />
                             </telerik:RadGridView.Columns>
 
 
                         </telerik:RadGridView>
                     </Grid>
                 </telerik:RadTabItem>
                 <telerik:RadTabItem Header="Tank Bottoms" Name="tankBottomsTabItem">
                     <Grid Background="White">
                         <Grid.RowDefinitions>
                             <RowDefinition Height="Auto" />
                             <RowDefinition Height="*" />
                         </Grid.RowDefinitions>
                         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                             <telerik:RadButton Content="Add New Tank Bottom" Click="AddTankBottomButton_Click" Width="150" Margin="0,0,5,0" />
                         </StackPanel>
                         <telerik:RadGridView Grid.Row="1" x:Name="tankBottomRadGridView" GroupRenderMode="Flat"
                          ItemsSource="{Binding TerminalConfigurationTankBottomVMs}"
                          Foreground="Black" Height="250" RowIndicatorVisibility="Collapsed"
                          AutoGenerateColumns="False" CanUserFreezeColumns="False" BorderThickness="0"
                          CanUserResizeColumns="False" ShowGroupPanel="False" BorderBrush="{x:Null}" Margin="0"
                                              EditTriggers="CellClick" CellEditEnded="CellEditEnded">
                             <telerik:RadGridView.Resources>
                                 <Style x:Key="GridViewToggleButtonColumnStyle" TargetType="telerik:GridViewCell">
                                     <Setter Property="Padding" Value="0,0,0,0" />
                                 </Style>
                             </telerik:RadGridView.Resources>
                             <telerik:RadGridView.Columns>
                                 <telerik:GridViewComboBoxColumn Header="Product" DataMemberBinding="{Binding ParentCommodityID}"
                                             SelectedValueMemberPath="CommodityID" DisplayMemberPath="CommodityName" ItemsSource="{Binding AllParentCommodities,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />
                                 <telerik:GridViewDataColumn Name="txtTankBottom" Header="Tank Bottom" DataMemberBinding="{Binding Bottom,ValidatesOnDataErrors=True}" Width="150" />
                                 <telerik:GridViewDataColumn Name="dpTankBottomEffectiveDate" Header="Effective Date" DataMemberBinding="{Binding EffectiveDate, StringFormat=d, ValidatesOnDataErrors=True}" Width="150" />
                             </telerik:RadGridView.Columns>
                         </telerik:RadGridView>
                     </Grid>
                     <!--<local:TerminalInventoryGridCommentView />-->
                 </telerik:RadTabItem>
             </telerik:RadTabControl>
         </DataTemplate>
         <DataTemplate x:Key="RowDetailsTemplate">
             <Grid>
             
                 <Grid.RowDefinitions>
                     <RowDefinition Height="Auto" />
                     <RowDefinition Height="*" />
                 </Grid.RowDefinitions>
                 <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                     <telerik:RadButton Content="Add New Terminal" Click="AddTerminalButton_Click" Width="150" Margin="0,0,5,0" />    
                 </StackPanel>
 
                 <telerik:RadGridView Grid.Row="1"  HorizontalAlignment="Stretch" Name="terminalGridView" VerticalAlignment="Stretch"
                          ItemsSource="{Binding TerminalConfigurationTerminalVMs}"
                          Margin="0" GroupRenderMode="Flat" RowIndicatorVisibility="Collapsed" IsReadOnly="False" AutoGenerateColumns="False"
                          CanUserFreezeColumns="False" CanUserResizeColumns="False" ColumnWidth="*" RowDetailsTemplate="{StaticResource ChildRowDetailsTemplate}"
                          AllowDrop="True" IsFilteringAllowed="False" CanUserReorderColumns="True" CanUserDeleteRows="False" CanUserSortColumns="False" CanUserSortGroups="False"
                          ShowGroupPanel="False" EditTriggers="CellClick" CellEditEnded="CellEditEnded">
             
                     <telerik:RadGridView.Columns>
                         <telerik:GridViewToggleRowDetailsColumn/>
                         <telerik:GridViewComboBoxColumn Name="cmbTerminalName" Header="Name" DataMemberBinding="{Binding TerminalID}"
                                             SelectedValueMemberPath="TerminalID" DisplayMemberPath="TerminalName" ItemsSource="{Binding AllTerminals, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Width="150"/>
                         <telerik:GridViewDataColumn Name="dpTerminalStartDate" Header="Start Date" DataMemberBinding="{Binding StartDate, StringFormat=d, ValidatesOnDataErrors=True, Mode=TwoWay}" Width="150" />
                         <telerik:GridViewDataColumn Name="dpTerminalEndDate" Header="End Date" DataMemberBinding="{Binding EndDate, StringFormat=d, ValidatesOnDataErrors=True, Mode=TwoWay}" Width="150" />
 
 
                     </telerik:RadGridView.Columns>
                 </telerik:RadGridView>
             </Grid>
         </DataTemplate>
     </Grid.Resources>
      
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
             <RowDefinition Height="*" />
         </Grid.RowDefinitions>
 
         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
             <telerik:RadButton Content="Add New Delivery Area" Click="AddDeliveryAreaButton_Click" Width="150" Margin="0,0,5,0" />
             <telerik:RadButton Content="Save Changes" Click="SaveChangesButton_Click" Width="150" Margin="0,0,5,0" />
         </StackPanel>
 
         <telerik:RadGridView Grid.Row="1"  HorizontalAlignment="Stretch" Name="parentGridView" VerticalAlignment="Stretch"
                          ItemsSource="{Binding TerminalConfigurationDeliveryAreaVMs}"
                          Margin="0" GroupRenderMode="Flat" RowIndicatorVisibility="Collapsed" IsReadOnly="False" AutoGenerateColumns="False"
                          CanUserFreezeColumns="False" CanUserResizeColumns="False" ColumnWidth="*" RowDetailsTemplate="{StaticResource RowDetailsTemplate}"
                          AllowDrop="True" IsFilteringAllowed="False" CanUserReorderColumns="True" CanUserDeleteRows="False" CanUserSortColumns="False" CanUserSortGroups="False"
                          ShowGroupPanel="False" EditTriggers="CellClick" CellEditEnded="CellEditEnded">
 
             <telerik:RadGridView.Columns>
                 <telerik:GridViewToggleRowDetailsColumn/>
                 <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding DeliveryAreaName}" />
                 <telerik:GridViewComboBoxColumn Name="cmbInventoryRegion" Header="Region" DataMemberBinding="{Binding InventoryRegion,Mode=TwoWay, ValidatesOnDataErrors=True}"
                                             ItemsSource="{Binding AllInventoryRegions}" />
                 <telerik:GridViewCheckBoxColumn Name="cbInactive" Header="Inactive" DataMemberBinding="{Binding Inactive}" />
 
             </telerik:RadGridView.Columns>
 
         </telerik:RadGridView>
 
     </Grid>
 
 </Grid>

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 07 Aug 2013, 08:05 AM
Hello,

Thank you for sharing the code you use.

It seems that the RadButton is visualized under the GridView. Would you please remove the 

HorizontalAlignment="Center" setting of the StackPanel?

Let me know how this works for you.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Matthew
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or