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

Grid View rows disabled

1 Answer 16 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mladen
Top achievements
Rank 1
Mladen asked on 09 Jun 2014, 07:24 AM
Hi, we have the problem shown in the attached picture. When grid view is loaded, last rows appear disabled. The XAML is the following:

<!--Test Interval Report-->
 <Style TargetType="telerik:RadGridView" x:Key="NestedRadGridView">
     <Setter Property="ShowColumnFooters" Value="False"/>
     <Setter Property="ShowGroupPanel" Value="False"/>
     <Setter Property="CanUserFreezeColumns" Value="False"/>
     <Setter Property="AutoGenerateColumns" Value="False"/>
     <Setter Property="ShowColumnHeaders" Value="False"/>
     <Setter Property="ShowInsertRow" Value="False"/>
     <Setter Property="RowIndicatorVisibility" Value="Collapsed"/>
     <Setter Property="Margin" Value="-6 -1 -3 0"></Setter>
     <Setter Property="Visibility" Value="{Binding ItemsSource, RelativeSource={RelativeSource Self}, Converter={StaticResource CollectionToVisibilityConverter}}"/>
 </Style>
 
 
 <DataTemplate x:Key="DetailedTestIntervalTagCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Tag}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalDescriptionCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Description}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalTestIntervalCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding TestIntervalValue}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalRemainingTimeToTestCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding RemainingTimeToTestValue}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalLastTestDateAndTimeCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding LastTestDateAndTimeValue}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalTestExpirationDateAndTimeCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding TestExpirationDateAndTimeValue}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 
 <DataTemplate x:Key="DetailedTestIntervalStatusCellTemplate" DataType="testIntervalReport:TestIntervalViewModel">
     <telerik:RadGridView ItemsSource="{Binding AllTestIntervals}" ShowColumnSortIndexes="False" Style="{StaticResource NestedRadGridView}">
         <telerik:RadGridView.Columns>
             <telerik:GridViewImageColumn IsReadOnly="True" DataMemberBinding="{Binding Status.UriSource}"/>
         </telerik:RadGridView.Columns>
     </telerik:RadGridView>
 </DataTemplate>
 <!--Test Interval Report-->
 
 
             <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" IsEnabled="{Binding AreSearchResultsValid}" Margin="6 0">
                 <Grid x:Name="SearchResultsGrid">
                     <Grid.RowDefinitions>
                         <RowDefinition Height="Auto"/>
                         <RowDefinition Height="Auto"/>
                     </Grid.RowDefinitions>
                     <telerik:RadGridView Margin="10" ItemsSource="{Binding TestIntervals}" EnableRowVirtualization="False" EnableColumnVirtualization="False"  Grid.Row="0" x:Name ="TestIntervalsGridView"
                                          ShowGroupPanel="False" Visibility="{Binding HasData, Converter={StaticResource BooleanToVisibilityConverter}}">
                         <telerik:RadGridView.Columns>
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalTagCellTemplate}">
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.Tag, Source={StaticResource CommonStrings}}" ToolTipService.ToolTip="{Binding Resources.TestIntervalDetailsTagTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center" />
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalDescriptionCellTemplate}" >
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.Description, Source={StaticResource CommonStrings}}" ToolTipService.ToolTip="{Binding Resources.TestIntervalReportDescriptionTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
 
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalTestIntervalCellTemplate}" >
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.TestInterval, Source={StaticResource Strings}}" ToolTipService.ToolTip="{Binding Resources.TestIntervalTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalRemainingTimeToTestCellTemplate}" >
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.RemainingTimeToTest, Source={StaticResource Strings}}" ToolTipService.ToolTip="{Binding Resources.RemainingTimeToTestTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalLastTestDateAndTimeCellTemplate}" >
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.LastTestDateAndTime, Source={StaticResource Strings}}" ToolTipService.ToolTip="{Binding Resources.LastTestDateAndTimeTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalTestExpirationDateAndTimeCellTemplate}" >
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.TestExpirationDateAndTime, Source={StaticResource Strings}}" ToolTipService.ToolTip="{Binding Resources.TestExpirationDateAndTimeTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
 
                             <telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource DetailedTestIntervalStatusCellTemplate}" DataMemberBinding="{Binding Status}">
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.Status, Source={StaticResource CommonStrings}}" ToolTipService.ToolTip="{Binding Resources.StatusTooltip, Source={StaticResource Strings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>
 
                             <!--<telerik:GridViewDataColumn IsReadOnly="True" CellTemplate="{StaticResource TestIntervalDetailsCellTemplate}" DataMemberBinding="{Binding Details}">
                                 <telerik:GridViewDataColumn.Header>
                                     <TextBlock Text="{Binding Resources.Action, Source={StaticResource CommonStrings}}" HorizontalAlignment="Center"/>
                                 </telerik:GridViewDataColumn.Header>
                             </telerik:GridViewDataColumn>-->
                              
                         </telerik:RadGridView.Columns>
                     </telerik:RadGridView>
                     <telerik:RadDataPager PageSize="{Binding PagerSize}"
                               Grid.Row="1" FontSize="12" Margin="10, -10, 10, 10"
                                           Visibility="{Binding PagerVisibility, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
                               Source="{Binding Items, ElementName=TestIntervalsGridView}"
                               IsTotalItemCountFixed="True"
                               DisplayMode="FirstLastPreviousNextNumeric, Text" />
                 </Grid>
             </ScrollViewer>

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 09 Jun 2014, 12:14 PM
Hello,

I looked through your project and I noticed that you defined a DataTemplate with a RadGridView in it. You are using it as a CellTemplate for the main GridView's columns. Thus, you have a RadGridView in each cell of the main RadGridView, am I right? Judging from the attached picture, you have a few cells, which have a multi-line content. If i am right, these should be separate GridViews with multiple rows.  However, there are neither vertical, nor horizontal lines. Moreover, the root border of RadGridView's template is not visible, which implies that you have a custom ControlTemplate, which I cannot find in the XAML that you have sent to us. Is this issue reproducible with the default styles? Additionally, can you please confirm whether the entire rows are disabled, propagating IsEnabled=false to their child controls, or only the RadGridViews are disabled. Generally, it will be great if you can send us a sample dummy project that illustrates this problem, as this looks like a heavily-customized scenario.
As a side note, I would like to mentiŠ¾n that this looks like a quite encumbered layout, with a very deep visual tree (which is slow, not only for initial parsing, but for propagating of layout changes at runtime). Have you considered replacing the nested RadGridViews, with simpler controls (i.e. System.Windows.Controls.ItemsControl)?

Regards,
Ivan Ivanov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Mladen
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or