简体   繁体   中英

Adding rows to a databound datagridview

I am loading data into a datagridview from a dataset. After loading I need to add new rows to the datagridview.

  1. Is there a way to add rows to a databound datagridview

or

  1. How can I unbind the datagridview
  2. the loaded data remain in the datagridview
  3. Add new rows to the datagridview

Try using BindingSource like

Dim m_Bs as new BindingSource


m_Bs.DataSource = DataSet1.Tables("TableName")
DataGridView1.Datasource = m_Bs

And enable adding row on DataGridView1 Any changes From the Datagridview will reflect on the Dataset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM