Can't add new record to Janus grid


Author
Message
Kingsley Price
Kingsley Price
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: StrataFrame Users
Posts: 4, Visits: 1.1K
I'm using typical BusinessBindingSource techniques to bind to Janus GridEX (3.5) control, all works well except when adding new records. The new values disappear from the grid when you move to the next row and you receive Null key value error when trying to save.  I have tested BO/BBS with DataGridView and it works fine.

Janus support suggests that ..."if you implement AddItem method in the IBindingList interface, it will add the records without the need of handling the GetNewRecord event" GetNewRecord  is a grid event to handle manually adding a new row to a collection or when implementing IList interface.

Seeing BBS implements IBindingListView I thought that AddItem would be handled.

Anyone had this problem, any ideas?
Replies
Kingsley Price
Kingsley Price
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: StrataFrame Users
Posts: 4, Visits: 1.1K
Trent, I have received this reply from Janus support team, is there any validity in what they are saying?

... "YourBusinessBindingSource does implement IBindingList but it doesn't implement allthe methods of the interface. In particular, the method that is not implementedcorrectly and the one that I think is causing the problem is IList.IndexOf.When the control uses IndexOf method in your BindingSource after adding theitem using AddNew, the method returns -1 while it should return 0 (when it isthe first item added or, the actual index of the item).

Try to implementthis method especially and the other methods in the IList interface and it shouldwork."...

 

 


Kingsley Price
Kingsley Price
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: StrataFrame Users
Posts: 4, Visits: 1.1K
Any suggestions or feedback ?

As a work around, do I need to sub-class the BBS and try to implement IList.IndexOf as suggested by janus guys?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search