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

RowDetailsTemplate causing an infinite loop

8 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 31 Jan 2012, 11:01 PM
Hi,

in my wpf usercontrol, I have a RadGridView with a RowDetailsTemplate inside of it. The template contain a RadTabControl and a only one TabItem with nothning inside of or if you want, we can add a TextBlock inside of it, it doesn't matter.

When I see my grid, I have my column with the "+" sign, when I click on the sign, my app hang and after 1 or 2 minutes, my Visual Studio tell me that I fall in an infinite loop.

Juste the fact to remove the RadTabItem it solve the problem!!!

Here is the xaml of my control:

<UserControl x:Class="com.christiegrp.Neuron.ClientApplication.BillingGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:helper="clr-namespace:com.christiegrp.Neuron.ClientApplication;assembly=ClientHelper"   
    Height="Auto" Width="Auto" Unloaded="UserControl_Unloaded">
   
    <UserControl.Resources>
        <ResourceDictionary>
            <helper:HospitalDate x:Key="DConverter" />
            <helper:HospitalTime x:Key="TConverter" />
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="BillingGrid-Fr-Res.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Neuron-Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
   
    <telerik:RadBusyIndicator Name="radBusyIndicator">
        <Grid Height="Auto" Width="Auto" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
           
            <!-- The following element is used to trigger an event allowing to replace the language resources before they are used. -->
            <TextBlock Initialized="ReplaceLanguageResources"/>
           
            <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock Name="Title1" HorizontalAlignment="Center" VerticalAlignment="Stretch" FontWeight="Bold" FontSize="16" TextWrapping="Wrap" Margin="5 5 5 0" Text="N/A"/>
                <TextBlock Name="Title2" HorizontalAlignment="Center" VerticalAlignment="Stretch" FontWeight="Bold" FontSize="12" TextWrapping="Wrap" Margin="5 0 5 0" Text="N/A"/>
            </StackPanel>
           
            <WrapPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="5 0 5 5">
                <telerik:RadButton CommandTarget="{Binding ElementName=radGridViewList}" Margin="0 5 0 0" Name="radButtonDatesRange" Click="radButtonDatesRange_Click" ToolTip="{Binding ElementName=Me, Path=DatesSelectionText}">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Calendar_32x32.png" Height="24" Width="24"/>
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Interval}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=radGridViewList}" Margin="0 5 5 0" Name="radButtonUndoDatesRange" Click="radButtonUndoDatesRange_Click" ToolTip="{StaticResource ResetInterval}">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="0" Source="Resources/Undo_32x32.png" Height="24" Width="24"/>
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=radGridViewList}" Margin="0 5 5 0" Name="radButtonRefresh" Click="radButtonRefresh_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Refresh_32x32.png" Height="24" Width="24"/>
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Refresh}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=radGridViewList}" Margin="0 5 5 0" Name="radButtonPatientFile" Click="radButtonPatientFile_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Patient_32x32.png" Height="24" Width="24" />
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource PatientFile}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=RadGridViewBilling}" Click="RadButton_Click" Tag="RebillStatementOfAccount" Margin="0 5 5 0">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Rebill_32x32.png" Height="24" Width="24" />
                        <TextBlock Name="textBlockRebill" Margin="5" VerticalAlignment="Center" Text="{StaticResource Rebill}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=RadGridViewBilling}" Click="RadButton_Click" Tag="Conciliate" Margin="0 5 5 0">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Conciliate_32x32.png" Height="24" Width="24" />
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Conciliate}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=RadGridViewBilling}" Click="RadButton_Click" Tag="SaveChanges"  Margin="0 5 5 0">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Save_32x32.png" Height="24" Width="24" />
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Save}" />
                    </StackPanel>
                </telerik:RadButton>
                <telerik:RadButton CommandTarget="{Binding ElementName=RadGridViewBilling}" Click="RadButton_Click" Tag="CancelChanges" Margin="0 5 0 0">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="5 0 0 0" Source="Resources/Cancel_32x32.png" Height="24" Width="24" />
                        <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Cancel}" />
                    </StackPanel>
                </telerik:RadButton>
            </WrapPanel>
           
            <telerik:RadGridView Height="Auto" Width="Auto" x:Name="radGridViewBilling" Margin="5 0 5 5" Visibility="Visible"  RowDetailsVisibilityMode="Collapsed"
            RowIndicatorVisibility="Collapsed" IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False" Grid.Row="2"
            CanUserResizeColumns="True" SelectionMode="Extended" ShowColumnFooters="True">

            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn />
            </telerik:RadGridView.Columns>

                <telerik:RadGridView.RowStyle>
                    <Style TargetType="telerik:GridViewRow">
                        <Setter Property="MinHeight" Value="40"/>
                    </Style>
                </telerik:RadGridView.RowStyle>

                <telerik:RadGridView.RowDetailsTemplate>
                    <DataTemplate>
                        <telerik:RadTabControl x:Name="RadTabControl1" BackgroundVisibility="Collapsed" Margin="10" Background="Transparent">
                            <!--
                            <telerik:RadTabItem Header="{StaticResource Transactions}">
                               
                                <telerik:RadGridView Height="Auto" Width="Auto" x:Name="radGridViewTransactions" AutoGenerateColumns="False"
                           CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
                           ShowGroupPanel="False"
                           Margin="0" IsReadOnly="True">

                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn Header="No" DataMemberBinding="{Binding TransactionSequence}" />
                                        <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding TransactionTimeStamp, Converter={StaticResource DConverter}}" />
                                        <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding TransactionTimeStamp, Converter={StaticResource TConverter}}" />
                                        <telerik:GridViewDataColumn Header="Type" DataMemberBinding="{Binding TransactionType}"  />
                                        <telerik:GridViewDataColumn Header="Montant" DataMemberBinding="{Binding Amount}" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                                        <telerik:GridViewDataColumn Header="Balance" DataMemberBinding="{Binding Balance}" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                                        <telerik:GridViewDataColumn Header="Commentaire" DataMemberBinding="{Binding Comment}" Width="250" />
                                    </telerik:RadGridView.Columns>                               
                                </telerik:RadGridView>                               
                            </telerik:RadTabItem>
                            -->
                           
                            <!--
                            <telerik:RadTabItem Header="{StaticResource Visit}">

                                <Grid Width="Auto" HorizontalAlignment="Stretch">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <TextBlock Text="Patient PHN:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="0" Grid.Column="0" />
                                    <telerik:RadMaskedTextBox x:Name="VisitPatientPHN" Value="{Binding PHN}" EmptyContent="Entrer patient PHN" MaskType="None" ValueChanged="RadMaskedTextBox_ValueChanged"  Margin="5" Grid.Row="0" Grid.Column="1"/>
                                    <TextBlock Text="Nom:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="1" Grid.Column="0" />
                                    <telerik:RadMaskedTextBox x:Name="VisitPatientName" Value="{Binding PatientName}" EmptyContent="Entrez nom patient" MaskType="None" ValueChanged="RadMaskedTextBox_ValueChanged"  Margin="5" Grid.Row="1" Grid.Column="1"/>
                                    <TextBlock Text="Province:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="2" Grid.Column="0" />
                                    <TextBox Text="{Binding PatientProvince}" Margin="5" Grid.Row="2" Grid.Column="1" />
                                    <TextBlock Text="Date visite:" TextAlignment="Right" Margin="5" FontWeight="Bold"  Grid.Row="0" Grid.Column="3" />
                                    <telerik:RadDatePicker x:Name="FromTimePicker" Margin="5" IsTooltipEnabled="False" SelectionChanged="FromTimePicker_SelectionChanged" DateTimeWatermarkContent="VisitDate" SelectedValue="{Binding VisitDate, Mode=TwoWay}" Grid.Row="0" Grid.Column="4" />
                                    <TextBlock Text="Code diag:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="1" Grid.Column="3" />
                                    <TextBox Text="{Binding DiagCode}" Margin="5" Grid.Row="1" Grid.Column="4" />
                                    <TextBlock Text="Code exam:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="2" Grid.Column="3" />
                                    <TextBox Text="{Binding ExamCode}" Margin="5" Grid.Row="2" Grid.Column="4" />
                                    <TextBlock Text="Mnt soumis:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="3" Grid.Column="3" />
                                    <telerik:RadMaskedTextBox x:Name="VisitAmountSubmitted" MaskType="Numeric" Mask="c" Value="{Binding AmountSubmitted}" EmptyContent="Entrer montant" Background="White" ValueChanged="RadMaskedTextBox_ValueChanged" Margin="5" Grid.Row="3" Grid.Column="4"/>
                                    <TextBlock Text="Commentaire:" TextAlignment="Left" Margin="5" FontWeight="Bold" Grid.Row="4" Grid.Column="0" />
                                    <TextBox Text="{Binding Comment}" Margin="5" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" />
                                </Grid>
                            </telerik:RadTabItem>
                            -->
                           
                            <!--
                            <telerik:RadTabItem Header="{StaticResource ErrorsReport}">                               
                                <telerik:RadGridView Height="Auto" Width="Auto" x:Name="radGridViewErrorsReport" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
                   CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
                   ShowGroupPanel="False"
                   Margin="0">

                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn Header="Nom fichier" DataMemberBinding="{Binding ReceivedFileName}" />
                                        <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding CreationTime, Converter={StaticResource DConverter}}" />
                                        <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding CreationTime, Converter={StaticResource TConverter}}" />
                                        <telerik:GridViewDataColumn Header="Message d'erreur" DataMemberBinding="{Binding ErrorMessage}" Width="250" />
                                    </telerik:RadGridView.Columns>                                   
                                </telerik:RadGridView>                               
                            </telerik:RadTabItem>
                            -->
                           
                            <!--
                            <telerik:RadTabItem Header="{StaticResource StatementOfAccount}">                               
                                <telerik:RadGridView Height="Auto" Width="Auto" x:Name="radGridViewStatementOfAccount" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
                   CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
                   ShowGroupPanel="False"
                   Margin="0">

                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn Header="Nom fichier" DataMemberBinding="{Binding ReceivedFileName}" />
                                        <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding CreationTime, Converter={StaticResource DConverter}}" />
                                        <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding CreationTime, Converter={StaticResource TConverter}}" />
                                        <telerik:GridViewDataColumn Header="Montant soumis" DataMemberBinding="{Binding AmountSubmitted}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                        <telerik:GridViewDataColumn Header="Montant payĆ©" DataMemberBinding="{Binding AmountPaid}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                        <telerik:GridViewDataColumn Header="Message d'erreur" DataMemberBinding="{Binding ErrorMessage}" Width="250" />
                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView>                               
                            </telerik:RadTabItem>
                            -->
                            <!--
                            <telerik:RadTabItem Header="{StaticResource RelatedBills}">
                                <TextBlock Text="Alain" />
                           
                                <telerik:RadGridView Height="Auto" Width="Auto" x:Name="radGridViewRelatedBills" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
                   CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
                   ShowGroupPanel="False"
                   Margin="0" />
                           
                            </telerik:RadTabItem>
                            -->
                            <telerik:RadTabItem Header="Performance Chart" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left">
                               
                            </telerik:RadTabItem>

                        </telerik:RadTabControl>
                    </DataTemplate>
                </telerik:RadGridView.RowDetailsTemplate>
            </telerik:RadGridView>
        </Grid>
    </telerik:RadBusyIndicator>
   
</UserControl>


Thank's

8 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Feb 2012, 09:15 AM
Hi Olivier,

I have tested the case on our demos, but still I was not able to reproduce the same behavior. Could you try to place the main grid in RadTabItem (not just in row details) - do you get the same issue occurring ? What is the version you are working with - could you test the application with our current official one - Q3 SP1 2011 ? 

Greetings,
Maya
the Telerik team

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

0
Oliver
Top achievements
Rank 1
answered on 01 Feb 2012, 03:55 PM
Hi Maya,

actually I'm using version 2011.3.1220.35

In the xaml I included in my post, in my row details, I have only one TabControl and 1 tabitem with nothing inside of it.
Just removing the TabItem solve the problem.

I try to put my main grid in a tabitem and the problem is still there :(

Thank's
0
Maya
Telerik team
answered on 02 Feb 2012, 08:40 AM
Hi Oliver,

I have tested the case, but still I am not able to reproduce the same behavior as the one you described. Could you take a look at the sample attached and let me know whether I am missing something ?  

Greetings,
Maya
the Telerik team

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

0
Oliver
Top achievements
Rank 1
answered on 02 Feb 2012, 03:19 PM
Hi Maya,

sorry but I cannot run your demo, I'm in .Net 3.5 and when I try to build your demo, I have the following error message:

------ Rebuild All started: Project: RadGridView_WPF_AR_24, Configuration: Debug x86 ------

Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5".

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /main:RadGridView_WPF_AR_24.App /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll /reference:C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll /reference:C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:Libs\Telerik.Windows.Controls.dll /reference:Libs\Telerik.Windows.Controls.GridView.dll /reference:Libs\Telerik.Windows.Controls.Input.dll /reference:Libs\Telerik.Windows.Controls.Navigation.dll /reference:Libs\Telerik.Windows.Data.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\x86\Debug\RadGridView_WPF_AR_24.exe /resource:obj\x86\Debug\RadGridView_WPF_AR_24.Properties.Resources.resources /target:winexe App.xaml.cs Club.cs MainWindow.xaml.cs MyViewModel.cs Player.cs Position.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs

D:\Developpement\Projets tests\RadGridView_Details\App.xaml.cs(13,23): error CS1558: 'RadGridView_WPF_AR_24.App' does not have a suitable static Main method

Compile complete -- 1 errors, 0 warnings

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



Thank's
0
Maya
Telerik team
answered on 03 Feb 2012, 09:25 AM
Hi Oliver,

I have retested the project I previously sent and I was not able to get the same exception. Nevertheless, can you take a look at its structure and settings and let me know whether it corresponds to your scenario as I am still not capable of reproducing the issue with the infinite loop ?  

Regards,
Maya
the Telerik team

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

0
Oliver
Top achievements
Rank 1
answered on 03 Feb 2012, 07:55 PM
Hi Maya,

ths problem is fixed ;)

Thank's
0
Rick
Top achievements
Rank 1
answered on 24 Apr 2012, 08:16 PM
If you don't mind me asking, What was the solution?
0
Oliver
Top achievements
Rank 1
answered on 24 Apr 2012, 09:13 PM
As far as I remembered, it was a bubbling event side effect.
I added more validation in one of my event attached to a control in my row detail template.
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Maya
Telerik team
Oliver
Top achievements
Rank 1
Rick
Top achievements
Rank 1
Share this question
or