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

grid causes silverlight application to crash

7 Answers 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 03 Feb 2011, 12:46 PM

Hi,

I am running a Silverlight 4 application containing two views, each view containing a grid which is created dynamically each time the view is shown. Occasionally the grid causes the application to crash:

Laufzeitfehler in Microsoft JScript: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: index
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.BringIndexIntoView(Int32 index)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.InternalBringIndexIntoView(Int32 index)
   bei Telerik.Windows.Controls.GridView.DataCellsPresenter.ScrollCellIntoView(Int32 index)
   bei Telerik.Windows.Controls.GridView.GridViewRow.ScrollCellIntoView(Int32 index)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollColumnIntoView(GridViewColumn column)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass6e.<ScrollIntoViewAsync>b__6d(FrameworkElement f)
   bei Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass77.<ScrollIntoViewRecursive>b__73()    

Version of grid view dll is 2010.3.1110.1040.

Can you help?

Thanks and regards
Stefan

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Feb 2011, 12:51 PM
Hello Stefan,

 This version in our Q3 2010. Can you try our latest service pack (Q3 2010 SP1) instead? 

Best wishes,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Ted
Top achievements
Rank 1
answered on 07 Feb 2011, 03:53 PM

Similar (maybe same) issue in the latest version:

Product: Telerik RadControls for Silverlight Q3 2010 SP1
Version: 10.3.1314.0
-----------------------
RadGridView control

You have some data (bound) in the control and you use grouping.
You try to use the 

BringIndexIntoView(int index)

 method in order to keep programmatic selection visible. Depending on the index you passed, there are two possible, both undesired outcomes:

1. If you pass the index argument a value in the range of top-level groups number, nothing happens.
2. If you pass index beyond the top-level group count, an exception is thrown (though it's still a valid row index):

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.BringIndexIntoView(Int32 index)
   at Telerik.Windows.Controls.GridView.BaseItemsControl.BringIndexIntoView(Int32 index)

Code example:

void MyServiceRequestCompleted(object sender, MyServiceRequestCompletedEventArgs e)
{
    radChart1.ItemsSource = e.Result;
  
    GridView1.GroupDescriptors.Clear();
    // NOTE! Removing this line (no grouping) fixes the problem:
    GridView1.GroupDescriptors.Add(new ColumnGroupDescriptor { Column = GridView1.Columns["MyGroupingPath"] });
    GridView1.ItemsSource = e.Result;
}
  
void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
{
    var item = e.DataPoint.DataItem;
    if (GridView1.Items.Contains(item))
    {
        GridView1.SelectedItem = item;
        int selectedIndex = GridView1.Items.IndexOf(item);
  
        // "Boom" when selectedIndex is greater than "MyGroupingPath" column distinct values
        GridView1.BringIndexIntoView(selectedIndex);
    }
}

 

0
Yordanka
Telerik team
answered on 10 Feb 2011, 10:31 AM
Hi,

We can confirm that BringIndexIntoView() has some problems in grouped scenario. We may suggest you to use ScrollIntoView() or ScrollIntoViewAsync() instead.
 
All the best,
Yordanka
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Alexey
Top achievements
Rank 1
answered on 16 Mar 2011, 12:10 PM
Hi,

i have the same disaster - use the Telerik-RadGridView and get the same error by binding(refreshing the table, wich currently not visible).

I use the version: 2010.3.1314.1040

Have you bugfree version??

Do your best,

Alexey.
0
Vlad
Telerik team
answered on 16 Mar 2011, 12:33 PM
Hi,

 Have you tried to use other methods as suggested in this thread? 

Greetings,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Alexey
Top achievements
Rank 1
answered on 16 Mar 2011, 12:37 PM
.. sorry, i've forgotten:
 I do not use BringIndexIntoView(int..) in my code!
0
Vlad
Telerik team
answered on 16 Mar 2011, 12:39 PM
Hi,

In this case can you post more info about the grid version and the exact problem at your end? Can you send us an example where we can reproduce this exception? 

Kind regards,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Stefan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ted
Top achievements
Rank 1
Yordanka
Telerik team
Alexey
Top achievements
Rank 1
Share this question
or