Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i have windows application. it contains 1 grid view 1 button(Add ) and 2 textbox. now i enter the value in text-box and click the add button, the values stored in grid view.
My question is add the value in grid view and close the form then reopen that form but the empty grid view will displayed. i want to previously added the items.

C#
private void button_Add_Click(object sender, EventArgs e)
       {
           
           dataGridView1.Rows.Add(textBox_Url.Text,textBox_Name.Text,textBox_password.Text);
           
           dataGridView1.Refresh();
       }
Posted
Comments
Suresh Suthar 24-Sep-13 3:12am    
You need to save this data to in DB or XML or somewhere else.

1 solution

First of all,DataGridView is used just to display data from some where. Its not as you mentioned the values stored in grid view. Its not there to store something. As you can see the comment you can store data into e.g. database.

Regards..
 
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