Declined
Last Updated: 19 Jun 2017 12:43 by ADMIN
ADMIN
Dimitar
Created on: 28 Feb 2017 07:48
Category: GridView
Type: Bug Report
1
FIX. RadGridView - the last programmatically added row is not added to the data source.
To reproduce
- Start the attached project press "Add in code"  then "Save"
- The row is still not added to the underlying data table. 

Workaround:
TryCast(Me.radGridView1.Rows.Last().DataBoundItem, IEditableObject).EndEdit()
1 comment
ADMIN
Ivan Petrov
Posted on: 22 Mar 2017 13:01
The reason the last row is not in the updated collection of the data source is that it is still in an open transaction for editing.
When one calls the AddNew method of RadGridView's Rows collection it calls the AddNew method of the underlying data source or creates and adds a new item in that data source. Then if the item is an IEditableObject instance it calls its BeginEdit method and returns it to the developer. The responsibility for ending that transaction lies within the developer and until that transaction is closed the row will be with a status that would not qualify it as changed.