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

Binder vs underlying DataTable

Thread ID:





15360 Jun 16,2004 05:14 PM UTC Jun 16,2004 09:55 PM UTC WinForms 4
Tags: GridControl
Lori S. Pearsall
Asked On June 16, 2004 05:14 PM UTC

After I execute a DeleteRecordsAtRowIndex, my grid is correct and Binder.RecordCount is correct but if I look at the underlying datasource (dataset.datatable.count), it doesn''t reflect the deletion. Is there an additional command that I need to flush the changes into the datasource? Also, if I do a DeleteRecordsAtRowIndex, it doesn''t appear that anything gets written into the UndoStack. Is this an action that can''t be undone?

Administrator [Syncfusion]
Replied On June 16, 2004 06:01 PM UTC

Undoing the deleting rows in a GridDataBoundGrid is not part of the standard undo support. I tried to see the problem you reported by adding a GridDataBoundGrid to form with a button and this handler. private void button1_Click(object sender, System.EventArgs e) { Console.WriteLine(dt.Rows.Count); this.gridDataBoundGrid1.DeleteRecordsAtRowIndex(1,1); Console.WriteLine(dt.Rows.Count); } dt is a DataTable that I had set to be the grid''s DataSource in formload. With this code I do not see a problem (using Can you tell me how to see this problem in one of our samples, or can you post a sample project showing the problem?

Lori S. Pearsall
Replied On June 16, 2004 07:22 PM UTC

Let''s see if this makes a difference ... In the Form constructor, I do the following : gridEvents.BeginUpdate(); gridEvents.Binder.SuspendBinding(); gridEvents.Binder.SetDataBinding(this.CaseDataSet.dsTimelineDatabase.CaseFact,null); gridEvents.Binder.ResumeBinding(); where CaseDataSet is a class, dsTimelineDatabase is a dataset and CaseFact is a datatable. The grid displays the correct information. If I start with two records and then delete one, Binder.RecordCount = 1 and this.CaseDataSet.dsTimelineDatabase.CaseFact.Count stays at 2.

Administrator [Syncfusion]
Replied On June 16, 2004 07:35 PM UTC

Using this code to set the datasource does not show any problem for me. this.gridDataBoundGrid1.Binder.SetDataBinding(ds.Tables[dt.TableName], null); You can set gridEvents.DataSource = this.CaseDataSet.dsTimelineDatabase.CaseFact; and this would be what I tried first. Can you post a sample project that does not work? Is it possible the table you are removing rows from is different from the table you are checking the rowcount on?

Lori S. Pearsall
Replied On June 16, 2004 09:55 PM UTC

I''m going to table this for now. It appears that the underlying table is being updated (the row is considered to be a "deleted row"). It is odd that our counts are different though. Will determine if this is a real issue when I implement the logic to flush the changes to the database.


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