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

[Solved] ArgumentOutOfRange issue

4 Answers 97 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.
Eugene Manuilov
Top achievements
Rank 1
Eugene Manuilov asked on 30 Oct 2009, 01:11 PM
Hi there!

I have a trouble with RadGridView control. When I click on Grid and then run scroll up I get ArgumentOutOfRangeException.
Version of Telerik controls is 2009.2.812.1030.

I have created new Silverlight application. This is main page of it:
<UserControl x:Class="SilverlightApplication1.MainPage" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
             mc:Ignorable="d"   
             d:DesignWidth="640" d:DesignHeight="480" 
             xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
             Loaded="UserControl_Loaded" 
             > 
  <Grid x:Name="LayoutRoot" Background="DeepSkyBlue">  
        <telerik:RadGridView x:Name="grid"    
                             ScrollViewer.HorizontalScrollBarVisibility="Auto" 
                             ScrollViewer.VerticalScrollBarVisibility="Auto" 
                             > 
        </telerik:RadGridView> 
    </Grid> 
</UserControl> 
And this is code behind:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Net;  
using System.Windows;  
using System.Windows.Controls;  
using System.Windows.Documents;  
using System.Windows.Input;  
using System.Windows.Media;  
using System.Windows.Media.Animation;  
using System.Windows.Shapes;  
using Telerik.Windows.Controls;  
 
namespace SilverlightApplication1  
{  
    public partial class MainPage : UserControl  
    {  
        public MainPage()  
        {  
            InitializeComponent();  
        }  
 
        private void UserControl_Loaded(object sender, RoutedEventArgs e)  
        {  
            for (int i = 0; i < 20; i++)  
            {  
                var column = new GridViewColumn();  
                column.Header = string.Format("Column {0}", i);  
                grid.Columns.Add(column);  
            }  
        }  
    }  
}  

Does anybody know what is it? And how to fix it?

4 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 30 Oct 2009, 03:36 PM
Hi Eugene,

This issue is already fixed - please try our latest internal build (or our latest beta).

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eugene Manuilov
Top achievements
Rank 1
answered on 30 Oct 2009, 03:49 PM
Ok.
Thank you for your cooperation.
0
Donald Hamm
Top achievements
Rank 1
answered on 30 Oct 2009, 04:56 PM
Just downloaded the latest and I'm getting this:

Value cannot be negative, infinite, or NaN.\r\nParameter name: System.Windows.CustomDependencyProperty

e.ExceptionObject.StackTrace:

System.Windows.Controls.Primitives.RangeBase.OnLargeChangePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
  at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
  at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
  at System.Windows.DependencyObject.SetValue(DependencyProperty property, Double d)
  at System.Windows.Controls.Primitives.RangeBase.set_LargeChange(Double value)
  at Telerik.Windows.Controls.GridView.ScrollBarStateController.UpdateScrollBar(ScrollBar scrollBar, ScrollBarProperties properties)
  at Telerik.Windows.Controls.GridView.ScrollBarStateController.UpdateVerticalScrollBarsProperties(ScrollBarProperties properties)
  at Telerik.Windows.Controls.GridView.GridViewScrollViewer.UpdateScrollBars()

I have the latest dev build.  This only happens on the 'second' loading of the grid with new data.  I apply search criteria, then get the data from my service. I then load the items source. I have this in the code:

 

this.RadGridQNoteDefects.ItemsSource = null;

 

 

 

this.RadGridQNoteDefects.ItemsSource = _ncds;

 

 

 

// to address a scroll bar bug in the grid, do this until the fix is release...

 

 

 

if (this.RadGridQNoteDefects.ItemsControl != null)

 

{

 

 

    this.RadGridQNoteDefects.ItemsControl.VirtualizingPanel.SetVerticalOffset(0d);

 

 

 

    this.RadGridQNoteDefects.ItemsControl.VirtualizingPanel.SetHorizontalOffset(0d);

 

}

 


only happens when rendering the grid again...

This worked fine in SL2, just converted to SL3 today and noticed this issue (no changes in code)...

-Don
0
Vlad
Telerik team
answered on 03 Nov 2009, 06:37 AM
Hi Don,

Please send us an example (via support ticket) where this exception can be reproduced.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Eugene Manuilov
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Eugene Manuilov
Top achievements
Rank 1
Donald Hamm
Top achievements
Rank 1
Share this question
or