For Example :
Parent Form Contains Grid that displays all Employee data and button Called "Add New Employee". On Add button Click, a Child Page is opening, where we can add a new Employee details, and on save button click, data should be saved in database and child form is closed. At the same time the saved employee data should reflect in the datagrid which is there in parent page.
For these kind of Criteria, please see the code below.
On Parent Form :
private void btnAdd_Click(object sender, EventArgs e)
{
frmChildForm frm2 = new frmChildForm();
frm2.FormClosed + = new FormClosedEventHandler(frm2_FormClosed);
frm2.Show();
}
private void frm2_FormClosed(object sender, FormClosedEventArgs e)
{
DataTable dt = new DataTable();
//get Eployee data from db and fill it dt;
dgvTesting.DataSource = dt;
this.Close();
}
Parent Form Contains Grid that displays all Employee data and button Called "Add New Employee". On Add button Click, a Child Page is opening, where we can add a new Employee details, and on save button click, data should be saved in database and child form is closed. At the same time the saved employee data should reflect in the datagrid which is there in parent page.
For these kind of Criteria, please see the code below.
On Parent Form :
private void btnAdd_Click(object sender, EventArgs e)
{
frmChildForm frm2 = new frmChildForm();
frm2.FormClosed + = new FormClosedEventHandler(frm2_FormClosed);
frm2.Show();
}
private void frm2_FormClosed(object sender, FormClosedEventArgs e)
{
DataTable dt = new DataTable();
//get Eployee data from db and fill it dt;
dgvTesting.DataSource = dt;
this.Close();
}
nice one.....
ReplyDeletehey div wer r u.. nicw blog
ReplyDeletethanks dude..........
ReplyDeletei love you;)
ReplyDeletethank you very much!
thaaaanks!
ReplyDeleteThanks bro..greate code..
ReplyDeleteThank you!!!
ReplyDeleteThanks divya,code was great help to me....
ReplyDeletegood job
ReplyDeletetnks men
ReplyDeleteStill very relevant and it save me a lot of time. Thanks for posting this.
ReplyDeleteNice. Very helpful blog. Keep doing like this.
ReplyDeleteBrilliant!!!!!!!!!!!!
ReplyDeletevery helpful
ReplyDeletePerfect Solution. Thanks for this help.
ReplyDeleteSuperb. Thanks!
ReplyDelete