TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abdul rehman sayed
NA
3
0
Problem Using Binding Source with Relations..
Mar 30 2010 7:53 AM
Hi All,
I am creating a C# winform in Dot Net ,
I have a datagridview control & a few Other Controls (2 Textbox).
In my DataSet there are two tables MasterParent(Code) ,MasterDetail(ParentCode).
Both are related by a FkRelation. Code is an AutoIncrementing Column.
I Create a binding source (b1) & set Mastertable as a DataSource to it. Now I assign b1 as a datsource to GridView.
I create another Binding Source(b2) & set b1 as datasource and fkRelation as DataMember.
Now I bind, the 2 textbox controls to b2 (by using DataBindings of TextBox).
In both the binding sources, AllowNew,AllowEdit,AllowRemove is set to true.
What I want to achieve is :
Whenever User Enters a new Record in datagridview, a New Row should get added in the Relation, For this I use UserAddedNew Row event of gridview & Call b2.AddNew();Also I set the FK Relation ParentCode in the textbox.
However, Once I Commit the gridview Row (i.e By moving up & down ), the Form View (i.e the texbox controls) Lose their Add new Event, and no data for b2 gets committed to the data source.
Kindly Help..
Reply
Answers (
2
)
Student blogs
How to bind dropdown list in MVC arcchicture?