Groups | Blog | Home
all groups > dotnet windows forms databinding > august 2004 >

dotnet windows forms databinding : Adding a new record



John
8/11/2004 3:12:17 PM
Hi

I have a set of fields which I have bound to properties from a class. I am
not using any context manager or anything like that, simply fields bound to
the datasource. How can I add a new record on this form via code?

Thanks

Regards


Sijin Joseph
8/11/2004 8:55:20 PM
Well, from what i can infer, to add a new record, you will need to create a
new instance of the class and databind that object to your fields. But you
most probably want to use collections so that you can navigate between
various instances of your objects. You will need to implement a custom
collection for that and make the collection implement IBindingList.

Take a look at this article from Rockford Lhotka, it should get you started
http://msdn.microsoft.com/vbasic/using/columns/adventures/default.aspx?pull=/library/en-us/dnadvnet/html/vbnet02252003.asp

--
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph


[quoted text, click to view]

AddThis Social Bookmark Button