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

AccessViolationException

4 Answers 75 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 20 Apr 2012, 05:08 AM
Ever since updating the SL5 I have been getting a ton of AccessViolationException errors.  They are difficult to troubleshoot because the browser just crashes, and VS doesn't tell me which part of the code is the issue.  Also it is intermittant. 

Finally I figured out a consistent way to duplciate it though only in my app.  If I open one of the column filter dialogs and check/uncheck a few in a row really fast, usually by the third one it will crash.  It doesn't matter how much data is in the grid.  I cannot duplicate it in the demo site unfortunately.  This is what the "Disassembly" looks like, I don't know what it means but it looks like the definition of a radComboBox which is in one of my grid columns:


--- STSilver\Main.xaml ---------------------------------------------------------

2076: Text="{Binding ClientName,Mode=TwoWay}"

nop

mov esp,ebp

pop ebp

ret 4

nop

2077: IsTextSearchEnabled="False"

2078: GotFocus="RadClientBox_GotFocus"

2079: SelectionChanged="radClientCombo_SelectionChanged"

2080: LostFocus="radClientCombo_LostFocus"

2081: ItemContainerStyle="{StaticResource CustomComboItem}"

2082: Style="{StaticResource RadComboBoxStyle}"

2083: Background="#00FF0000" AllowDrop="False"

2084: KeyUp="RadClientBox_KeyUp"

2085: Foreground="{Binding ClientName, Converter={StaticResource ForegroundConverter}}"



I don't know exactly what the above means but I guessed that the combo binding was an issue.  I took out the binding, and then it crashed on another combo box.  So I think it is related to the radcombobox binding.

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 20 Apr 2012, 12:40 PM
Hello,

How is the RadComboBox defined for the GridViewDataColumn? Do you get the same problem with the latest binaries? What about if you remove the column with the RadComboBox?

All the best,

Didie
the Telerik team

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

0
Kjell
Top achievements
Rank 1
answered on 20 Apr 2012, 05:26 PM
Below is the full column definition.  Get rid of the two way databinding will get rid of the error.

I am using the Q1 2012 SP1 bins, I'll see if there is something more recent I can try.
<telerik:GridViewDataColumn Header="Client" Width="160" SortMemberPath="ClientNum" DataMemberBinding="{Binding ClientName}" >
                                               <telerik:GridViewDataColumn.CellStyle>
                                                   <Style TargetType="telerik:GridViewCell">
                                                       <Setter Property="Template">
                                                           <Setter.Value>
                                                               <ControlTemplate TargetType="telerik:GridViewCell">
                                                                   <StackPanel Name="stackClient" Background="Transparent">
                                                                       <Border BorderBrush="DarkGray" BorderThickness="0,0,1,0" VerticalAlignment="Stretch" x:Name="brdClient">
 
                                                                           <telerik:RadComboBox x:Name="radClientCombo"
                                                                           SelectAllTextEvent="None" Height="24"
                                                                           IsEditable="True"
                                                                           CanAutocompleteSelectItems="False"                                                                                                                                                                                                 
                                                                           CanKeyboardNavigationSelectItems="True"
                                                                           IsFilteringEnabled="False"
                                                                           Text="{Binding ClientName,Mode=TwoWay}"
                                                                           IsTextSearchEnabled="False"
                                                                           GotFocus="RadClientBox_GotFocus"                                                                                                
                                                                           SelectionChanged="radClientCombo_SelectionChanged"
                                                                           LostFocus="radClientCombo_LostFocus"
                                                                           ItemContainerStyle="{StaticResource CustomComboItem}"
                                                                           Style="{StaticResource RadComboBoxStyle}" 
                                                                           Background="#00FF0000" AllowDrop="False"
                                                                           KeyUp="RadClientBox_KeyUp" 
                                                                           Foreground="{Binding ClientName, Converter={StaticResource ForegroundConverter}}"                                                                                          
                                                                                                />
 
                                                                       </Border>
                                                                       <Border BorderBrush="DarkGray" BorderThickness="0,0,1,0" VerticalAlignment="Stretch" x:Name="brdDisabledClient"
                                                                               Visibility="Collapsed" Padding="6,6,6,6" >
 
                                                                       </Border>
                                                                   </StackPanel>
                                                               </ControlTemplate>
                                                           </Setter.Value>
                                                       </Setter>
                                                   </Style>
                                               </telerik:GridViewDataColumn.CellStyle>
                                           </telerik:GridViewDataColumn>
0
Kjell
Top achievements
Rank 1
answered on 20 Apr 2012, 05:56 PM
Same result with the 4/16 hot fix binaries.  Please let me know if something is wrong with the above code sample.  This has been working fine for almost 2 years, but seems like there are a lot of issues with SL5 not necessarily related to Telerik.  Maybe it has something to do with itemssource being null?

Let me describe my scenario a bit further... the combobox in question is used as an autocomplete, and it does not get populated with options until the user types in it.  However the value may already be assigned and in that case I just stick the sting in combobox.text.  If the value is not assigned then I put a message in the box so either way I put a string in combobox.text but there is no itemssource.
0
Dimitrina
Telerik team
answered on 21 Apr 2012, 02:23 PM
Hi,

 I have created a test project using your code snippet (I have removed all the styles and events which definitions are not provided in the snippet). So far I was not able to get any error.

This could be a problem with the Silverlight 5 as suggested here.

All the best,
Didie
the Telerik team

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

Tags
GridView
Asked by
Kjell
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or