Out of Range exception editing datatable

3 posts, 0 answers
  1. Josh
    Josh avatar
    29 posts
    Member since:
    Feb 2009

    Posted 30 Aug 2011 Link to this post

    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. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 02 Sep 2011 Link to this post

    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 >>

  3. Josh
    Josh avatar
    29 posts
    Member since:
    Feb 2009

    Posted 02 Sep 2011 Link to this post

    Done.   Ticket ID 460424
Back to Top