Click here to Skip to main content
15,904,346 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi I have a datagridview with some records and below that a Button(Add) is there whenever i click on that it is navigating to another form and that form contain textbox's and a button, when i filled those txtbox's and press the button it is navigating to parent form along with the textbox's value now my rquirement is i want to create a new row and putting those textbox's values into the datagridview newly created cells,Please help me.
Posted
Updated 26-Mar-12 18:12pm
v2
Comments
Mateen Khan 27-Mar-12 0:31am    
You want this for Winforms or ASP.NET???

1 solution

Since you have written "Form" there so am assuming this to be a winform app.

What i have understood from your question is when you return back to the grid form you want the values of textbox to be reflected in grid. Correct me if i am wrong.
My awnser to this will be: You should first let the gridview have columns as DataGridViewTextBoxColumn. Now You might be binding the datagridview with some collection object(like arraylist) or DataTable. What you can do is in the edit form add the values entered to the collection. when you come back from the edit form to grid just rebind the grid again with the collection object. Hope this will solve your problem if i've understood your question correctly.
Waiting for your response on this.
 
Share this answer
 

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