Go to the next gridview Row
How Can I go to the next Datagridview Row to add a result?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted Jul 22, 2008, 1:22 PM
//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