Go to the next gridview Row
How Can I go to the next Datagridview Row to add a result?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Jul 22, 2008, 9:22 AM EDT
//First we have to make a DataGridViewRow to be inserted into the datagridview.
DataGridViewRow newRow = new DataGridViewRow();
//Next you would need to fill this row with data. You can manually fill it using newRow.Cells[x] = "Anything"
//After filling up the DataGridViewRow , you need to insert it.
this.dataGridView1.Rows.Insert("CRITICAL (Y/N)"+ 1, newRow)
//Next Refresh the datagrid view
DataGridView1.Refresh();
//If the sort doesn't take effect, you can reset the sort using this method.
this.dataGridView1.Sort(this.dataGridView1.Columns[x], ListSortDirection.Ascending | ListSortDirection.Descending);
For more tips you can refer the following URL:
http://dotnetperls.com/Content/DataGridView-Tips.aspx