gridGroupingControl.DataSource as DataTable DefaultView and TableAdapter.Update

Hi

after pressing  button1   

filtr 'bmw 1'

  private void button1_Click(object sender, EventArgs e)

        {

  DataView _product = ((DataTable)product_gridGroupingControl2.DataSource).DefaultView;

            _product.RowFilter = Filter_textBox.Text;

        }

after pressing  button3

        private void button3_Click(object sender, EventArgs e)

        {

            int i = 100;

            foreach (DataRowView drv in ((DataTable)product_gridGroupingControl2.DataSource).DefaultView)

            {

                drv["project"] = i;

                drv["UnitPrice"] = i *2;

                i++;

            }

            Table t = product_gridGroupingControl2.Table;

            t.SelectedRecords.Add(product_gridGroupingControl2.Table.Records[0]

     }

after pressing  button3   - does not save all changes that are visible in ggc to the database

  product_TableAdapter.Update(dstest009, "Product");

please help

Gregory






gridGroupingControl.DataSource as DataTable).DefaultView

TableAdapter.Update


Attachment: test_GGC_001_9b891ac4.rar

2 Replies

BT Balamurugan Thirumalaikumar Syncfusion Team September 16, 2021 03:11 AM UTC


Hi Gregory, 
 
 
Thank you for interesting in Syncfusion products.  
 
We have checked your previous update at our end. We are validating the reported scenario. We will check and provide you the further details on  September 17,2021. We appreciate your patience and understandings till then.  
 
Balamurugan Thirumalaikumar 
 



BT Balamurugan Thirumalaikumar Syncfusion Team September 17, 2021 11:09 AM UTC

Hi Gregory, 

Thank you for patience. 

We have checked your previous update at our end. You could use the DataTable to update the real-time changes in the underlying datasource (DataTable), use the DataTable. AcceptChanges and Table. Reload method. Please refer the following code snippet for your reference. We would like to let you know that the gridGroupingControl update the changes only in bounded collection. If you want to make this changes in your database, you could manually update your database using SourceListRecordChanging, SourceListRecordChanged and RecordValueChanged events. in this event you can access if the records are being added, updated or deleted by using the Action property. 

Code Snippet 
// must call this to add row in table   
this.table.AcceptChanges();  
  
// it reloads the datatable rows.  
this.gridGroupingControl1.Table.Reload(); 

You can refer the following KB and Forum for your reference. 



Please let us know if you would require any other assistance. We will always happy to help you out. 

Thanks & Regards, 
Balamurugan Thirumalaikumar

Loader.
Up arrow icon