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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using 'both' Paging and Binding with VB.Net SfDataGrid not saving edits.

Thread ID:





145479 Jun 24,2019 07:39 PM UTC Jun 26,2019 01:01 PM UTC WinForms 3
Tags: SfDataGrid
Asked On June 24, 2019 07:39 PM UTC


Thanks for looking in advance, I'm only a hobbyist so sorry for the code :-)
I'm trying to use both Paging and Binding with VB.Net SfDataGrid however my updates are not being saved back to the DB. I'm using the following code:

Imports System.Data.SQLite
Imports Syncfusion.WinForms.DataGrid.Enums

Module Mod_DataBindingDGV

    Public testTable As New DataTable
    Public bindingSource1 As New BindingSource
    Public adapter As New SQLiteDataAdapter
    Public builder As New SQLiteCommandBuilder(adapter)

    Public Sub GetDataGridView(ByVal sqlString As String)
        Dim sqlCommand As String = sqlString
        Dim SQLconnect As New SQLite.SQLiteConnection With {
    .ConnectionString = Mod_SQLConnections.CreateSQLiteConnectionString

        testTable = New DataTable

        adapter = New SQLiteDataAdapter(sqlCommand, SQLconnect)
        bindingSource1.DataSource = testTable


        Form1.SfDataPager1.DataSource = bindingSource1
        Form1.SfDataPager1.PageSize = 5
        Form1.SfDataGrid1.DataSource = Form1.SfDataPager1.PagedSource
        Form1.SfDataGrid1.AllowEditing = True
        Form1.SfDataGrid1.EditMode = EditMode.DoubleClick
    End Sub

On Form1

AddHandler SfDataGrid1.CurrentCellEndEdit, AddressOf sfDataGrid_CurrentCellEndEdit

    Private Sub sfDataGrid_CurrentCellEndEdit(ByVal sender As Object, ByVal e As CurrentCellEndEditEventArgs)
        MessageBox.Show("The editing is completed for the cell (" & e.DataRow.RowIndex & "," & e.DataColumn.ColumnIndex & ")")
    End Sub

The data is loaded as expected and pages correctly, also the edit completed MessageBox fires.

Thanks Andy

Adhikesevan Kothandaraman [Syncfusion]
Replied On June 25, 2019 01:48 PM UTC

Hi Andy, 

Thanks for using Syncfusion products. 

By default, while editing the cell or row in the SfDataGrid will update the value only in the view. It will not updated to the underlying data source. If you want to update the source once the field is edited in the grid, you have to manually update the value by calling the update method. Please refer to the following code snippet, 

Code Snippet:  
 //To update the data in the DataSource  


Replied On June 26, 2019 02:24 AM UTC


I got this to work however I had to remove 'SfDataPager' element from the form completely otherwise the adapter.Update(testTable) has no changes. Also I rearranged the order to:


Not sure how I can use 'SfDataPager ' and still use adapter.Update(testTable).


Adhikesevan Kothandaraman [Syncfusion]
Replied On June 26, 2019 01:01 PM UTC

Hi Andy, 
Regret for the inconvenience caused. 
By default, the SfDataPager does not support the DataTable as the DataSource. So that can you please try this with the IEnumerable collections. 
Please find the following UG link for the limitation.  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon