You are trying to do some very basic stuff, so as I mentioned in my previous post, it would help if I could see a sample so I know what you are doing. An invalid cast exception can from from a lot of places. The grid can play a role in this since you are binding...so my guess is that you have some logic somewhere within the grid or other event that is causing the issue. Without seeing a reproduction it is going to be hard to give you any straight answers.
/Ulrik
Normally everything is working, but when I add the BusinessBindingSource component to my winform and binds it the forms primary BO, it crashes with the InvalidCastException error.
Do you have any ideas on why this is happening ??
If I delete the BBS it is working like a dream! The reason that I'm using this is because I need to include a DevExpress editbox for currency/numeric data entry!!
RegardsUlrik
After I went to the BOM and changed the Field Properties on the PK field it seems to work without any exception.
I changed th "NULL Value Option" to "Return Alternate on Null" and let it set nospace "" in the replacement value!
I just don't know why I have this kind of problems with this specific BO!
/ULRIK
The PK field is a VarChar(5) - in other tables i'm using VC(10) in the same manner!!!
In the SetDefaultValues on the BO i'm making a >> this.pr_id = "ABC"; <<
I tried to run the application on a computer without VS2008 installed - it seems to work better - no crash at least!
The destination table and it happens everytime I click the NEW buttom!!!!!
What the he.. is going on... Am I missing a flag or.....
Hope that some of you can come up with a way to get me back on track!