Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add row in between two rows in datagridview in c#

I have an application that include a 'datagridview' that use to type the contents directly. It appears like a notepad.

Right now I need a solution that I want to add a row in between two already added/typed rows. Please help me to find the solution.

like image 408
Anoop Narayan Avatar asked Nov 02 '22 21:11

Anoop Narayan


1 Answers

You can use the DataGridView.Rows.Insert(int rowIndex, DataGridViewRow dataGridViewRow) which can insert a DataRow at particular/desired index.

More details at MSDN

Overloads for Insert Method

like image 57
Parimal Raj Avatar answered Nov 15 '22 06:11

Parimal Raj