We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UpdatingRecord Event

Thread ID:

Created:

Updated:

Platform:

Replies:

7007 Sep 9,2003 05:57 PM UTC Sep 9,2003 09:28 PM UTC WinForms 1
loading
Tags: GridControl
Omar
Asked On September 9, 2003 05:57 PM UTC

I am implementing a custom collection that implements both IBindingList and IListSource and inherits from CollectionBase. I have no problem binding my collection to the grid. My question: 1) how can I save changes made by the user to the collection 2) is there an (UpdatingRecord) like event that occurs before the changes made by the user are committed to the datasource (so that data can be validated and the event canceled if necessary) 3) is there an (AddingRecord) like event that occurs before adding a new record to the datasource (so that a new item can be created in the collection and data can be validated and canceled if necessary) OMAR P.S: when should we expect to see V2.0 of the grid!!

Administrator [Syncfusion]
Replied On September 9, 2003 09:28 PM UTC

1) You can have the objects in your datasource implement IEditableObject interface. You can take a look at the Syncfusion\Essential Suite\Grid\Samples\DataBound\Hierarchical\Customers that uses a IBindingList datasource. 2) From the GridDataBoundGrid, you can use the RowLeave event which can be cancelled and happens as you leave a row. You can check grid.Binder.IsAnyDirtyField to see if any changes needs saving. 3) There is no AddNewRow event, but you can do this in the RowEnter event checking whether you are on the last row. Here is some code that adds a new row to a DataTable in RowEnter.
Private Sub gridDataBoundGrid1_RowEnter(sender As Object, e As GridRowEventArgs) Handles GridDataBoundGrid1.RowEnter

   If Me.gridDataBoundGrid1.Model.RowCount = e.RowIndex Then
      Dim dt As DataTable = CType(Me.gridDataBoundGrid1.DataSource, DataTable)
      Dim dr As DataRow = dt.NewRow()
      ’populate your new row however you want
      dr(0) = "col0"
      dr(1) = "col1"
      dt.Rows.Add(dr)
   End If
End Sub ’gridDataBoundGrid1_RowEnter
The 2.0 beta will start in a week or so.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;