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

Some bugs

6 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 11 Feb 2010, 08:22 AM
Hi,

In my application I have a grid where  all columns are build dynamically in the code behind.
The user can, with the aid of a combobox, select a different layout for the gridview.

When there are many columns in the grid (and the horizontal scrollbar is visible) then I get the following error when I change the
layout:
System.ArgumentOutOfRangeException was unhandled by user code
  Message=Specified argument was out of the range of valid values.
Parameter name: index
  Source=Telerik.Windows.Controls.GridView
  ParamName=index
  StackTrace:
       at Telerik.Windows.Controls.GridView.MultipleCopiesCollection.get_Item(Int32 index) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\MultipleCopiesCollection.cs:line 289
       at System.Windows.Data.ListCollectionView.InternalItemAt(Int32 index)
       at System.Windows.Data.ListCollectionView.GetItemAt(Int32 index)
       at System.Windows.Controls.ItemCollection.GetItemAt(Int32 index)
       at System.Windows.Controls.ItemCollection.get_Item(Int32 index)
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.VirtualizeChildren(List`1 blockList, IItemContainerGenerator generator) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 1193
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.GenerateAndMeasureChildrenForRealizedColumns(Size constraint) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 189
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size constraint) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 86
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  InnerException:

In the same scenerio I found an other bug: when I switch between layouts where
in one layout ShowInsertRow = true and in the other false then I get:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.GridView
  StackTrace:
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.SetDataGridCellPanelWidth(IList children, Double newWidth) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 1454
       at Telerik.Windows.Controls.GridView.GridViewCellsPanel.ArrangeOverride(Size arrangeSize) in c:\Builds\WPF_Scrum\GridView_WPF_2009_Q3_SP1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 1508
       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
       at System.Windows.UIElement.Arrange(Rect finalRect)
       at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
       at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
       at System.Windows.UIElement.Arrange(Rect finalRect)
       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
       at System.Windows.UIElement.Arrange(Rect finalRect)
       at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
       at System.Windows.UIElement.Arrange(Rect finalRect)
       at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
       at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
       at System.Windows.UIElement.Arrange(Rect finalRect)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  InnerException:



6 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 11 Feb 2010, 12:21 PM
Hi,

I don't get these errors when I set:
EnableColumnVirtualization = False and EnableRowVirtualization = False.

But after I do that the gridview becomes very irresponsive.

Thomas.
0
Vlad
Telerik team
answered on 11 Feb 2010, 12:26 PM
Hello,

Do you have our latest service pack?

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Thomas
Top achievements
Rank 1
answered on 11 Feb 2010, 01:45 PM
Hi,

I think so. That is: 2009.3.1405.35.
Running now under visual studio 2010 and  .net 4.0 release candidate.

Kind regards,
Thomas
0
Vlad
Telerik team
answered on 17 Feb 2010, 06:48 AM
Hello,

Please open support ticket and send us small example demonstrating your scenario where we can reproduce and debug this. We will let you know immediately about our findings.

All the best,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Thomas
Top achievements
Rank 1
answered on 17 Feb 2010, 08:57 AM
Hi Vlad,

What are the conditions for opening a support ticket?

The code below reproduces the error.
Thanks.

Imports System.Collections.ObjectModel 
Imports Telerik.Windows.Controls 
Class MainWindow 
 
    Private cars As New ObservableCollection(Of Car) 
    Private cartypes As New ObservableCollection(Of CarType) 
 
    Private Sub MainWindow_Loaded(ByVal sender As ObjectByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded 
        cartypes.Add(New CarType With {.CarTypeID = 1, .Type = "Ford"}) 
        cartypes.Add(New CarType With {.CarTypeID = 2, .Type = "Mercedes"}) 
 
        cars.Add(New Car With {.Owner = "You", .CarTypeID = 1}) 
        cars.Add(New Car With {.Owner = "Me", .CarTypeID = 2}) 
        GridView1.FieldDescriptors.Add(New GridViewDataColumn With {.Header = "Owner", .UniqueName = "Owner"}) 
        GridView1.FieldDescriptors.Add(New GridViewComboBoxColumn With {.Header = "Type", .UniqueName = "CarTypeID"
                                                                      .SelectedValueMemberPath = "CarTypeID"
                                                                      .DisplayMemberPath = "Type"}) 
        GridView1.ItemsSource = cars 
 
    End Sub 
 
    Private Sub button1_Click(ByVal sender As System.ObjectByVal e As System.Windows.RoutedEventArgs) 
        GridView1.FieldDescriptors.Clear() 
        GridView1.FieldDescriptors.Add(New GridViewDataColumn With {.Header = "Owner", .UniqueName = "Owner"}) 
       
        CType(GridView1.Columns(1), GridViewComboBoxColumn).ItemsSource = cartypes 
    End Sub 
End Class 


<Window xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"  x:Class="MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="160" 
      
    Title="MainWindow"
    <Grid> 
        <StackPanel> 
            <my:RadGridView Name="GridView1" AutoGenerateColumns="False"
             
        </my:RadGridView> 
        <Button Name="button1" Click="button1_Click">Click for bug</Button> 
            </StackPanel> 
    </Grid> 
</Window> 
0
Vlad
Telerik team
answered on 18 Feb 2010, 01:50 PM
Hello Thomas,

Actually this code will raise argument exception since you are trying to access second column however you have just one. Maybe you have missed some piece of code for button1_Click?

I've attached small demo project demonstrating your scenario - everything worked fine on my end.

Regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or