Problem with Binding Source

Problem with Binding Source

Old forum URL: forums.lhotka.net/forums/t/11225.aspx


megha posted on Monday, March 12, 2012

Quick reply please.........

Hi..

I have a Grid for selecting a Type name from a pop-up form .This gridview is bound to a BindingSource.For a existing item, when I try to add new item to grid,multiple records are added with blank type names, Its going to many times to the following piece of code

protected override object AddNewCore()

 

CSLA Version 3.0.5.0

 

 

JonnyBee replied on Monday, March 12, 2012

Sounds like your code inside AddNewCore calls AddNewCore recursively (f.ex by calling list.AddNew).

What is the code inside AddNewCore?

megha replied on Monday, March 12, 2012

protected override object AddNewCore()

    {

      DepartmentType item = DepartmentType.NewADepartmentType();

      this.Add(item);     

      return item;

    }

JonnyBee replied on Wednesday, March 14, 2012

Have you added additional code to events in the binding source?

Anyhow - you need to set a breakpoint inside AddNewCore and inspect the call stack when the call comes in for the first, second and third time. This should help you pinpoint where AddNewCore is called from.

Copyright (c) Marimer LLC