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

Release Error but not in Debug Mode

11 Answers 235 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adam
Top achievements
Rank 1
Adam asked on 09 Jul 2014, 08:58 PM
Hello I am having an issue with the radgridview. The error does not occur with the debugger attached.
But in either IE or Chrome It crashes silverlight and the browser.
No error is caught in the unhandled exception event either.

The grid is generated in code at runtime, in a custom control.

I am not using the grid normally (horizontally). I am using it as a UI to allow the user to build a filter, with which I generate a sql statement , and fill a result grid.
Each row of the last column is for the filter value. it can be text box, combobox, checkbox or a datetime picker in edit mode. 
Each row is a new filter.

All the controls are successfully created, all the combobox itemsources (a property on the filter object) are loaded.
The control rests inside an expander, as soon as that expander is opened and the grid being displayed it blows up.
I am 95% sure that the issue rests with the combobox rows. But I could be wrong. There is logging in the ControlType Converters
and the Template Selectors. when the debugger is not attached it never gets to that level.
When I turn off the preloading of the grid's comboboxes. I can load the grid, display it and I can click on any row. that is not a combobox till I click on the combobox.
It goes down, I select something all good till I click on another row then it blows up , no error no dump nothing.

I have so much logging that I have more logging code that actual code but can still not find the error/problem.  With the debugger attached it logs. Every event I could think of each step of the way.

I would appreciate any help you could give. Ideas.  If you need anything else I can post snippets of w/e.

Screenshot of the control working
With Debugger Log
Without Debugger Log


Control XAML
<UserControl
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="OSMRP1.GridEngine.GridFilter"
    xmlns:GridEngine="clr-namespace:OSMRP1.GridEngine"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:converters="clr-namespace:Telerik.Windows.Documents.Converters;assembly=Telerik.Windows.Controls.FixedDocumentViewers"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
 
    <UserControl.Resources>
        <!-- Control Converter -->
        <GridEngine:FilterControlTypeConverter x:Key="valuecontrolconverter"  />
        <GridEngine:FilterValueConverter x:Key="valueconverter"  />
        <converters:BoolToVisibilityConverter x:Key="boolvisibleconverter"  />
         
        <DataTemplate x:Key="ComboItemTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="100" />
                </Grid.ColumnDefinitions>
                <Border Background="#77AAAAAA">
                    <TextBlock Text="{Binding ID}" />
                </Border>
                <Border Grid.Column="1"
                        Margin="4,0,0,0"
                        Background="White">
                    <TextBlock Text="{Binding Name}" />
                </Border>
            </Grid>
        </DataTemplate>
 
        <DataTemplate x:Key="captiondisplay">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
                <TextBlock Text="*" Visibility="{Binding is_required, Converter={StaticResource boolvisibleconverter}}" FontWeight="Bold"
                Foreground="Green"  />
                <TextBlock Text="{Binding caption}" />
            </StackPanel>
        </DataTemplate>
         
        <!-- Edit Templates -->
        <DataTemplate x:Key="valueEditTextBox">
            <TextBox Text="{Binding value, Mode=TwoWay,
                ValidatesOnDataErrors=True, NotifyOnValidationError=True,
                UpdateSourceTrigger=PropertyChanged}" Background="white"  />
        </DataTemplate>
         
        <DataTemplate x:Key="valueEditComboBox">
            <ComboBox DisplayMemberPath="Name" SelectedValuePath="ID"
               ItemsSource="{Binding ItemSource, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
               SelectedItem="{Binding value, Mode=TwoWay, Converter={StaticResource valueconverter},  UpdateSourceTrigger=PropertyChanged}"
               IsEnabled="{Binding HasAllTagValues}"  Loaded="ComboBox_Loaded" BindingValidationError="ComboBox_BindingValidationError"  />
        </DataTemplate>
        <DataTemplate x:Key="valueEditCheckBox">
            <CheckBox IsChecked ="{Binding value, Mode=TwoWay, Converter={StaticResource valueconverter}, UpdateSourceTrigger=PropertyChanged}" Background="white"  HorizontalAlignment="Center" />
        </DataTemplate>
        <DataTemplate x:Key="valueEditDateTimePicker">
            <telerik:RadDateTimePicker SelectedValue="{Binding value, Mode=TwoWay, Converter={StaticResource valueconverter}, UpdateSourceTrigger=PropertyChanged}"  Background="white" />
        </DataTemplate>
 
        <!-- Display Templates -->
        <DataTemplate x:Key="valueDisplayTextBox">
            <TextBlock Text="{Binding ValueText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        </DataTemplate>
        <DataTemplate x:Key="valueDisplayComboBox">
            <TextBlock Text="{Binding ValueText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        </DataTemplate>
        <DataTemplate x:Key="valueDisplayCheckBox">
            <CheckBox IsChecked ="{Binding value, Mode=TwoWay, Converter={StaticResource valueconverter}, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" />
        </DataTemplate>
        <DataTemplate x:Key="valueDisplayDateTimePicker">
            <telerik:RadDateTimePicker InputMode="DatePicker" SelectedValue="{Binding value, Mode=TwoWay, Converter={StaticResource valueconverter}, UpdateSourceTrigger=PropertyChanged}"  Background="white" />
        </DataTemplate>
         
        <!-- Display Mode Rules-->
        <GridEngine:FilterDataTemplateSelector x:Key="DisplayControlRules" ConditionConverter="{StaticResource valuecontrolconverter}">
            <GridEngine:FilterDataTemplateSelector.Rules>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueDisplayTextBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>0</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueDisplayComboBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>1</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueDisplayCheckBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>2</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueDisplayDateTimePicker}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>3</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
            </GridEngine:FilterDataTemplateSelector.Rules>
        </GridEngine:FilterDataTemplateSelector>
         
        <!-- Exit Mode Rules-->
        <GridEngine:FilterDataTemplateSelector x:Key="EditControlRules" ConditionConverter="{StaticResource valuecontrolconverter}">
            <GridEngine:FilterDataTemplateSelector.Rules>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueEditTextBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>0</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueEditComboBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>1</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueEditCheckBox}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>2</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
                <GridEngine:FilterDataTemplateRule DataTemplate="{StaticResource valueEditDateTimePicker}">
                    <GridEngine:FilterDataTemplateRule.Value>
                        <sys:Int32>3</sys:Int32>
                    </GridEngine:FilterDataTemplateRule.Value>
                </GridEngine:FilterDataTemplateRule>
            </GridEngine:FilterDataTemplateSelector.Rules>
        </GridEngine:FilterDataTemplateSelector>
 
 
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.988,0.988" StartPoint="0.019,0.025">
                <GradientStop Color="Black" Offset="0.391"/>
                <GradientStop Color="#FFD5C4C4" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <telerik:RadBusyIndicator Grid.Row="1" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Name="busyIndicator" IsBusy="False" IsIndeterminate="True">
            <telerik:RadGridView x:Name="rgvFilter" Grid.Row="1" CanUserReorderColumns="False" CanUserInsertRows="False" 
                CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserSortColumns="False"
                CanUserSortGroups="False" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False"
                d:LayoutRounding="Auto" ShowColumnHeaders="False"
                IsFilteringAllowed="False" ShowGroupPanel="False"
                AutoGenerateColumns="False"
                IsSynchronizedWithCurrentItem ="True"
                VerticalAlignment="Stretch"
                HorizontalAlignment="Stretch"
                RowIndicatorVisibility="Collapsed"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                VerticalContentAlignment="Top"
                RowStyle="{StaticResource PhoenixGridViewRowStyle}"
                DataLoaded="rgvFilter_DataLoaded" DataContextChanged="rgvFilter_DataContextChanged"
                RowLoaded="rgvFilter_RowLoaded" BindingValidationError="rgvFilter_BindingValidationError" Loaded="rgvFilter_Loaded" BeginningEdit="rgvFilter_BeginningEdit" DataError="rgvFilter_DataError"
                                  
                                 >
            </telerik:RadGridView>
        </telerik:RadBusyIndicator>
    </Grid>

</UserControl>






Platform 
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938
Telerik Silverlight VSExtensions   2014.1.318.0
Telerik UI for Silverlight VSExtensions

11 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 10 Jul 2014, 12:43 PM
Hi Adam,

This indeed seems a very strange behavior. However I am not able to reproduce it on our side. Is it possible to provide a small sample implementation that reproduces the behavior, in order to be able to observe the scenario and provide a solution in the shortest terms? 

Regards,
Nik
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.
 
0
Adam
Top achievements
Rank 1
answered on 10 Jul 2014, 03:13 PM
I can take the the code out to make a sample running application. But to make a new application that runs is going to take some time.
I am really stumped here, and under a lot of pressure to fix this. So I'll do what ever. :)  We would even let telerik remote into my pc.
If that is what it took.

The code

The code is a little "hacked" right now because I have spent the last two days. But this is all the code that is relevant.
Let me know if you need a functioning app Or anything else.
Please help me Obi-wan you are my only hope! :)
0
Adam
Top achievements
Rank 1
answered on 10 Jul 2014, 09:16 PM
Ok here is a functioning version (in debug mode) application.
Everything is included, including a database (aventureworks) with everything included.
PS The database and connection string is designed to work with Windows Authentication. From Local Host SQL Server 2008R2

Sample Code
0
Adam
Top achievements
Rank 1
answered on 14 Jul 2014, 01:33 PM
Any thoughts?
0
Nick
Telerik team
answered on 15 Jul 2014, 11:00 AM
Hello Adam,

We were able to run the sample, however we were not able to restore the database. Is it the default adventureWorks databese, are there any changes that you have done over it? If so, would it be possible to send a script for the databese? 

Thank you in advance. 

Regards,
Nik
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.
 
0
Adam
Top achievements
Rank 1
answered on 15 Jul 2014, 01:51 PM
:(.
Can you tell me what the error is?

I have scripts for the tables, sps and functions I created.
But no data. And setting up the grid and filter options in the table. are dependent on the



I am using AdventureWorks (AWBuildVersion)
SystemInformationID    Database Version              VersionDate ModifiedDate
1 9.06.01.05.00            2006-01-05 15:44:08.347 2006-01-05 15:44:08.347
0
Adam
Top achievements
Rank 1
answered on 15 Jul 2014, 01:54 PM
rename the jpg to .zip and it will work.

I'll try and get you the data.
0
Adam
Top achievements
Rank 1
answered on 15 Jul 2014, 02:55 PM
Here is the scripts to the entire database with data. Hopefully this will work for you.
Database Script Zipfile
0
Nick
Telerik team
answered on 16 Jul 2014, 07:25 AM
Hello Adam,

Thank you for the scripts. I will try to run the project with them, however I doubt the problem is related to the Database. It would be really helpful and will greatly reduce the time that it takes to isolate the issue and find a solution if you could provide a small sample that shows only the faulty behavior. You can read this blog post on how to isolate a problem in a sample solution

Regards,
Nik
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.
 
0
Adam
Top achievements
Rank 1
answered on 16 Jul 2014, 02:34 PM
What I am trying to do is quite complex. And it only fails when the Telerik Rad Grid I am using to display the Filters is shown
and only in release mode. Essentially this system, Is a query builder for the a radgrid.
Everything is stored in our database, the query base, what columns the result grid is to have, what captions it has, what filters are needed the type and source of the controls. These values stored into the database are loaded into objects, and the filter objects are loaded and added to the grid. If the filter grid is not shown it works, once the radgrid that is being used to display the filter, is shown (it is hidden by an expander) , it fails. No error message , not even an unhandled exception. The browser crashes, no error and no dump that I could find. The radgrid being used for the result is fine. I want to use the radgrid for the filter because 1 it looks better, and 2 it has the DataTemplateSelectors. As each row in the filter grid can have a different control type for the filter's value column. It would take a long time to remove all the database stuff. If you are unable to use the database, I can try but it may be simpler at that point to use a listbox. 



0
Yoan
Telerik team
answered on 21 Jul 2014, 12:01 PM
Hi Adam,

I have reviewed your case but I was not able to identify what is the reason for the unwanted behaviour. Generally, if we can reproduce it on our side we will try to resolve it. Unfortunately, in this case we were not able to reproduce this issue.

It would be of great help if you could isolate the problem in a simple project so we can reproduce it on our side. This will enable us to determine the cause of the problem and to provide an accurate solution.

Thank you in advance.


Regards,
Yoan
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
Adam
Top achievements
Rank 1
Answers by
Nick
Telerik team
Adam
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or