INSERT for DataGridView

F

Frank Werner

Hello Chris,

please send me your code or describe your needs more detailed

regards

frank
 
G

Guest

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
 
G

Guest

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.
 
F

Frank Werner

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top