Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
How to delete row in grid, and delete that record in the datatable also
posted

 I have an ultragrid, it is bound to a bindingsource, this binding source is created by BindingSource= new bindingsource(dataset, "TableName"), and then datagrid.datasource=BindingSource.

When I delete one row in the datagrid, that is is disappeared, but in the dataset, that record is still existed in the datatable, and the RowState is "unchanged".

so the record is deleted from datagrid, but not deleted from datasource.

who can help me with this?

Parents
No Data
Reply
  • 469350
    Offline posted

    I'm not sure why that would be. The grid commits changes to the data source based on the UpdateMode property, which defaults up updating when the active cell changes or the grid loses focus. Deleting a row in the grid should certainly cause a change in the ActiveCell. So maybe you have changed the UpdateMode property of the grid to some other setting?

    Try calling grid.UpdateData and see if that helps. 

    How are you getting the data row? Are you sure it's the right row?

Children