INSERT for DataGridView

  • Thread starter Thread starter Guest
  • Start date Start date
Hello Chris,

please send me your code or describe your needs more detailed

regards

frank
 
I don't know if sending any code will help. I have a databound grid and I
need to find a way to "insert" a new row in a specified location within that
grid of data. I am not sure if it is even possible with a databound grid but
I am trying.

I saw this link but I do not know how to use it.
THanks
 
I tried this and apparently you cannot use when data-bound
scriptDataGridView.Rows.Insert(2, 1);

So, I am in trouble. I may have to redesign the entire project to unbound
mode.
 
correct, you cannot insert rows between other rows via the DataGridView.Rows.Insert
method when it is bound.
You should try to insert the row in the datasource, probably the datatable
and revresch the view

eg.

yourDataRow= yourDataTable.NewRow();
yourDataRow["columname"] = "content";
yourDataTable.Rows.Add(yourDataRow);

Hope this helps

regards

Frank
 
Back
Top