Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m having 2 form in form1 i m having one add new button and datagridview and in form2 many textboxs to insert and update. when i click on addnew button which is on form1,a form2 will open and so that i can insert the data, after inserting a data into a server immediately a insert has to shown on datagridview (form1)without closing a form2 and form1
Posted

Hi,

Look at this article, it does exactly what you need.

DataGridView with Detail Edit Form - VS 2005[^]

there is a datagridview in the sample the uses a BindingSource bound to a dataset

Friend WithEvents OrdersBindingSource As System.Windows.Forms.BindingSource
(...)
Me.OrdersDataGridView.DataSource = Me.OrdersBindingSource



Now in the form that edits the record, comment out Me.Close()

You will see that each time the record is committed to the database the grid in the parent form refreshes itself automatically.

Valery.
 
Share this answer
 
You might want to use INotifyPropertyChanged - http://msdn.microsoft.com/en-us/library/ms184414.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900