CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Problem with Binding Source

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 3 Replies | 1 Follower

Not Ranked
2 Posts
Megha V posted on Mon, Mar 12 2012 5:21 AM

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

 

 

All Replies

Top 10 Contributor
1,815 Posts
Suggested by JonnyBee

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

What is the code inside AddNewCore?

Jonny Bekkum, Norway CslaContrib Coordinator

Not Ranked
2 Posts

protected override object AddNewCore()

    {

      DepartmentType item = DepartmentType.NewADepartmentType();

      this.Add(item);     

      return item;

    }

Top 10 Contributor
1,815 Posts

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.

Jonny Bekkum, Norway CslaContrib Coordinator

Page 1 of 1 (4 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems