Exception when add and remove item from radBook by programming

3 posts, 1 answers
  1. King Chan
    King Chan avatar
    30 posts
    Member since:
    Feb 2010

    Posted 09 Jul 2010 Link to this post


    I was trying to add user control or radBookItem by programming, using methods radBook.Items.Add method and radBook.Items.remove/removeAt/removeAll.

    I created the radBook in xaml, then add the item in C#.
    When it add the item(s), the radBook works fine.
    The number of items in the radBook returned right number too.
    But when I try to remove it (removeAll/removeAt(0)/remove) it will gaves me exception saying that the argument is out of range.

    If I add the item though xaml, it has no problem with removing it.
    But the point is that I need to create the pages dynamically in C#.
    Is there something I did wrong?

    Debug Log:



    'sllauncher.exe' (Silverlight): Loaded 'c:\Program Files (x86)\Microsoft Silverlight\4.0.50524.0\en-US\mscorlib.debug.resources.dll'

    A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.dll

    Specified argument was out of the range of valid values.
    Parameter name: index

    RadBookItem randomitem = new RadBookItem();
                randomitem.Width = 500;
                randomitem.Height = 500;
  2. Answer
    Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 14 Jul 2010 Link to this post

    Hi King,

    This issue is fixed and the fix will be available with our official release which is in few days. I'm attaching a sample project demonstrating your scenario. Have a look at it and let me know if you manage to reproduce the issue again.

    Kiril Stanoev
    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
  3. King Chan
    King Chan avatar
    30 posts
    Member since:
    Feb 2010

    Posted 15 Jul 2010 Link to this post

    Yes, it worked prefectly, thanaks.
Back to Top