Golda
Golda

Reputation: 3891

Add New Row at Middle of Gridview

i want to add new row at middle of the gridview. How to achieve this.

The Gridview bind by DataTable. In DataBound Event I want to add new row in particular row, using row index

Upvotes: 1

Views: 1975

Answers (1)

Nagaraj S
Nagaraj S

Reputation: 13484

You can insert a row at specific position use the API of your binding source. For example if the grid is bound to a DataTable use the following code:

DataRow row = table.NewRow();
table.Rows.InsertAt(row, 5);

DataGridView.Rows Property

Upvotes: 2

Related Questions