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?
Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I have never tried the Janus grid before, but it should work.  If the standard DataGridView works, then there is probably something else happening on the Janus side.  The DevExpress and Infragistics grids are used in vast numbers with the SF BBS, so I doubt that there is anything that should be changed.  I also know that the SF BBS works with the Telerik grids as I have recently tried that out.

Do you have a stack trace coming back?
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
Thanks Trent. Trace (attached) is from GridEx AddingRecord event, after which entered data disappears and a blank row is left in the Grid. I can send sample project if you wish.

Also got this (clue maybe) of a DevEx forum "...With GridEX (janus), when you add a new row, there is no need to add a new row/record to the datasource first. You can put values in the column and once they are completed/validated, it is only at that point that a new row/object is requested. GridEX then SETs all of the values and the new row/record is then added to the data source..."


update: just discoverd that the newly added grid row is being overridden by the BO's default values. Initially I had them = nothing, now have I have given them values I can see this happening. So it looks like an event timing issue? 
Attachments
JanusGridTestStackTrace.txt (153 views, 9.00 KB)
Edited 12 Years Ago by Kingsley Price
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