Sending data from a form to another
-
Hi all, i want to know how can I add data in a form from another form and display it in a datagrid after adding it to the first form pleeease help thanx
-
Hi all, i want to know how can I add data in a form from another form and display it in a datagrid after adding it to the first form pleeease help thanx
Passing Values between Forms in .NET 1.x with C# and VB.NET examples[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Hi all, i want to know how can I add data in a form from another form and display it in a datagrid after adding it to the first form pleeease help thanx
it will best if you use event handler in Child Form and Call it from Parent Form. class FrmChild { public event System.EventHandler addData; ......... ...... } class FrmParent {..... private void btnSchduler_ClickEvent(......) { FrmChild obj=new FrmChild(); obj.addData +=new EventHandler(objServices_addService); obj.ShowDialog(); } private void objServices_addService(object sender, EventArgs e) { //write code to Add in Data Grid.... } } Sanjit.rajbanshi@wlinktech.com
-
Hi all, i want to know how can I add data in a form from another form and display it in a datagrid after adding it to the first form pleeease help thanx
First I decrypted your question :) Then I found out that, you can do it by creating a new constructor which takes a datatable in the second form. Then from first form, you send the datatable to the second forms constructor where it is used as Form2.CustomDataGrodView.DataSource = datagridViewFromConstructor. Or you can add a property(public DataTable NewDataSource {get; set;}) or method like (UpdateDataSource(DataTable newDataSource)) then call these from your First Form with a new DataTable. Hope this helps...