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

[Solved] GridViewScrollViewerTemplate NullReference error when editing the template on expression blend

5 Answers 132 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.
Ivan
Top achievements
Rank 1
Ivan asked on 17 Aug 2011, 10:54 PM
Hi I cannot edit on expression blend the GridViewScrollViewer template

I get a null reference error

<!--Begin GridViewScrollViewer-->
<ControlTemplate x:Key="GridViewScrollViewerTemplate"
                 TargetType="telerik:GridViewScrollViewer">
    <Grid x:Name="PART_RootPanel"
          Background="{TemplateBinding Background}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <telerik:ScrollContentPresenter Grid.Row="2"
                                        CanContentScroll="{TemplateBinding CanContentScroll}" />
        <ScrollBar x:Name="PART_VerticalScrollBar"
                   IsTabStop="False"
                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                   Grid.Column="1"
                   Grid.Row="0"
                   Grid.RowSpan="4"
                   Orientation="Vertical"
                   ViewportSize="{TemplateBinding ViewportHeight}"
                   Maximum="{TemplateBinding ScrollableHeight}"
                   Minimum="0.0"
                   Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                   telerik:StyleManager.Theme="{StaticResource Theme}" />
 
        <ScrollBar x:Name="PART_HorizontalScrollBar"
                   IsTabStop="False"
                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                   Grid.Column="0"
                   Grid.Row="4"
                   Orientation="Horizontal"
                   ViewportSize="{TemplateBinding ViewportWidth}"
                   Maximum="{TemplateBinding ScrollableWidth}"
                   Minimum="0.0"
                   Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                   telerik:StyleManager.Theme="{StaticResource Theme}" />
        <Rectangle Grid.Column="1"
                   Grid.Row="4"
                   Fill="{StaticResource MainBrush}" />
    </Grid>
</ControlTemplate>
<Style TargetType="telerik:GridViewScrollViewer">
    <Setter Property="Template"
            Value="{StaticResource GridViewScrollViewerTemplate}" />
</Style>
<!--End GridViewScrollViewer-->

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 Aug 2011, 06:14 AM
Hello Ivan,

 
Indeed we are aware of such an issue related to the Blend Support of RadGridView.


For the time being I may suggest you to use the following workaround:
Before dropping the GrdViewScrollViewer just get an empty RadGridView from Assets library and drop it onto the Artboard. Then you will not get this exception within Expession Blend's design surface. 


Please excuse us for any inconvenience caused!



Regards,
Vanya Pavlova
the Telerik team

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

0
Ivan
Top achievements
Rank 1
answered on 18 Aug 2011, 06:36 AM
Thanks for your answer Vanya,

I will try it...

Just one more thing I'm getting the NullReference error on runtime but it doesn't appear very frequently (in a RadGridView with too many columns with the HorizontalScrollbar visible), it happens once time a day I think and it is when i move the HorizontalScrollBar... my application crashes after the error...

BTW are you russian?

Best Regards...
0
Vanya Pavlova
Telerik team
answered on 18 Aug 2011, 08:10 AM
Hello Ivan,

 

May you post more info about the grid version? Is it our latest official release Q2 2011?


Greetings,
Vanya Pavlova
the Telerik team

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

0
Ivan
Top achievements
Rank 1
answered on 18 Aug 2011, 03:14 PM
Hi Vanya


I'm using the next version     RadControls_for_Silverlight4_2011_2_0815


Also is very difficult to replicate the error, like I told you doesn't happen very often


Best Regards,
Ivan


0
Vanya Pavlova
Telerik team
answered on 18 Aug 2011, 03:41 PM
Hello Ivan,

 


Regarding the fact that this behavior does not  always happen it is hard to determine what might be causing it. For the time being I hope that the proposed workaround in my previous reply is enough to avoid this error. 


Best wishes,
Vanya Pavlova
the Telerik team

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

Tags
GridView
Asked by
Ivan
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Ivan
Top achievements
Rank 1
Share this question
or