• Welcome to Valhalla Legends Archive.
 

[VB.NET] Datagridview add new row

Started by peoman, September 11, 2006, 01:34 PM

Previous topic - Next topic

peoman

Newbie problem

I'm trying to create a new row to a datagridview.
I want to get the values of the cells from textboxes.
Everything i have tried, i always get this message:
"Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound."

Any help???

I also want to be able to search in the datagrid.
How can i "select a row" when the index of a cell is equal or contains letters from a textbox?Huh

(I hope you can understand my english)

MyndFyre

Sounds like you shouldn't be trying to add rows after the control is databound.  You programatically data bind the control.  So look into that.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

peoman

I'm trying to use Suspend/Resume Binding like this:

DataGridView1.BindingContext(AuthorsDataSet, "authors").SuspendBinding()
DataGridView1.Rows.Add(New String() {"1", "2"})
DataGridView1.BindingContext(AuthorsDataSet, "authors").ResumeBinding()

but i still can't create a new row. What am i doing wrong?