Hi,
I am new to c#. I am developing an application using VS.Net 2005 in c#. I have around 10 text boxes in say Form1. I key in all the data in the text boxes.
There is a checkbox on Form1, on clicking it another form say Form2 opens. Form2 has some data displayed in datagrid view. I choose a particular row and click the ok button. The data in the row should populate three text boxes on Form1.
What happens is... the three text boxes get populated by the data i selected from From2 but the 10 text boxes on Form1 (which already contained data) get reset (data gets erased)
Not able to figure out what's wrong.. pl help
Regds,
Jonik
Loading
carle laiPosted Sep 23, 2009, 1:34 AM
I think you can achieve it by javascript!
Kumar AGPosted Sep 14, 2009, 2:24 PM
NikhilPosted Sep 14, 2009, 1:49 PM
I tried using the delegate to pass data between forms. Yes the code works much better. Now I do not have multiple instances of form1 open... but my problem still persists.. i.e the data I already entered on form1 does not "persist" when the data from form2 gets populated on form1.
Any means to make the data persist on form1?
Regards,
Jonik
NikhilPosted Sep 13, 2009, 11:04 AM
Thanks for the help.. since I am new to c# may require more help. Anyways will try as suggested by you.
Thanks,
Jonik
Roei BarPosted Sep 12, 2009, 7:53 AM
create a Delegate on the form that will be accessible via a public method to be invoked, this way you can pass data between forms
NikhilPosted Sep 12, 2009, 7:20 AM
Thanks but i do not know which part of the code to send.. so i will restate my problem
Form 1 - 13 text boxes out of which 10 are with data, 1 chkbox - when clicked opens Form2. I do not hide Form1
Form2 - with data in Gridview display. I select a particular row and press OK button. Hides Form2.
Form1 - the data corresponding to the row selected in Form2 above gets into the remaining three text boxes (which is what i want) but the data that was already in the 10 text boxes vanishes..
Hope i was able to define my problem clearly.
Regds,
Jonik
Ramalingam SPosted Sep 12, 2009, 6:26 AM
can u send some codes. so that i can understand clearly whats ur problem is.
bcz, if u recall the form1 means u cant able to retrieve the data.