Exception on BeginInsert

5 posts, 1 answers
  1. Helly
    Helly avatar
    6 posts
    Member since:
    Sep 2010

    Posted 07 Sep 2010 Link to this post

    I have a RadGridView, that is programmably populated with items.
    Like this:

    public void BindData()

     

     

    {

    radGridView.Columns.Clear();

     

     

    if ((SystemLookUpModel)DataContext == null) return;

     

     

     

    GridViewDataColumn gc = new GridViewDataColumn();

     

    gc.Header = 

     

    "Option";

     

     

    gc.UniqueName = 

     

    "Name";

     

     

    gc.DataMemberBinding = 

     

    new Binding("Name");

     

     

    radGridView.Columns.Add(gc);

     

     

    foreach (SystemLookUp slu in ((SystemLookUpModel)DataContext).ProgramType.SystemLookUp)

     

     

    {

     

     

    NumericUpDownColumn gc2 = new NumericUpDownColumn();

     

     

    gc2.Header = slu.Name;

    gc2.UniqueName = 

     

    string.Format("ProgramID{0}", slu.ID);

     

     

    gc2.DataMemberBinding = 

     

    new Binding(gc2.UniqueName);

     

     

    radGridView.Columns.Add(gc2);

    }

    LoadRows();

     

     

    }

    private void LoadRows()

     

     

    {

     

     

    IList list = (IList)((SystemLookUpModel)DataContext).GetServiceInProgramsDataSource();

     

     

    radGridView.ItemsSource = list;

    radGridView.SelectedItem = list.Count == 0 ?

     

    null : list[0];

     

     

    }

     

    I am adding rows with button add like this:

    private void btnAdd_Click(object sender, RoutedEventArgs e)

     

     

    {

    radGridView.BeginInsert();

    }

     

    The problem: sometimes, only when grid got focus, but not the first time, when I press Add button, I got the Exception:
    Specified argument was out of the range of valid values. Parameter name: index
    It is thrown 2 times, one after another. The new row created and selected, but it does not enter the edit mode. If I manually double-click it it works OK.
    Can you help me with this problem?
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Sep 2010 Link to this post

    Hi Helly,

    I would need a bit more specifics about your application. What exactly is inside the SystemLookUpModel? What is the funcionality of the GetServiceInProgramsDataSource() method ? How are you defining your xaml file ? It would be great if your could provide some code-snippets or a sample project.
     

    Kind regards,
    Maya
    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. DevCraft banner
  4. Helly
    Helly avatar
    6 posts
    Member since:
    Sep 2010

    Posted 08 Sep 2010 Link to this post

    Hi, Maya

    I've created a sample project with this problem, but it seems I can't upload it to this thread.
    So I attached it to a a support ticket # 346202
    Hope, you wiil receive it and help to fix the problem.
  5. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Sep 2010 Link to this post

    Hello Helly,

    We did have a bug on Clearing of the Columns but it has already been fixed. So, all you need to do is to upgrade to our latest version that you can download from your Telerik Account.
     

    Greetings,
    Maya
    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
  6. Helly
    Helly avatar
    6 posts
    Member since:
    Sep 2010

    Posted 14 Sep 2010 Link to this post

    Thank you.
    We download the newer version and exception is gone.
Back to Top
DevCraft banner