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

Out of Range exception editing datatable

2 Answers 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 30 Aug 2011, 04:46 PM
I have a very simple RadGridView with its ItemsSource set to a datatable which I found here:
http://blogs.telerik.com/blogs/posts/10-01-22/how_to_serialize_your_datatable_to_silverlight_using_wcf_service.aspx

The grid loads fine but whenever I edit a cell and hit return, I receive an ArgumentOutOfRangeException.  Strangely, If I click on a column to sort it first and then edit a cell, everything works as expected.

Sample code below.  How can I prevent this error?

<Grid x:Name="LayoutRoot" Background="White">
    <telerik:RadGridView x:Name="gv1" ValidatesOnDataErrors="None"/>       
</Grid>

Private Sub MainPage_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    Dim Items As New List(Of Dictionary(Of String, Object))
    Dim Row1 As New Dictionary(Of String, Object)
    Row1.Add("Column1", "item1")
    Row1.Add("Column2", "item2")
    Row1.Add("Column3", "item3")
    Items.Add(Row1)
 
    Dim Row2 As New Dictionary(Of String, Object)
    Row2.Add("Column1", "item4")
    Row2.Add("Column2", "item5")
    Row2.Add("Column3", "item6")
    Items.Add(Row2)
 
    gv1.ItemsSource = New Telerik.Data.DataTable(Items)
End Sub

Thanks,

-Josh

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 02 Sep 2011, 11:34 AM
Hi Josh,

It took me some time to try reproduce the error here  but to no avail . I would offer an alternative way to assist you . Can you please attach your project. I will be glad to perform a small debugging session over it and see what goes wrong.

* In order to be able to attach a project you will need to open a support ticket.

Best wishes,
Pavel Pavlov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Josh
Top achievements
Rank 1
answered on 02 Sep 2011, 03:11 PM
Done.   Ticket ID 460424
Tags
GridView
Asked by
Josh
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Josh
Top achievements
Rank 1
Share this question
or