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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

add records after remove records

Thread ID:





6125 Jul 31,2003 07:30 PM Aug 1,2003 01:52 AM Windows Forms 1
Tags: GridControl
Asked On July 31, 2003 07:30 PM

As below: I first remove records of grid,then Init grid from another DataSet,but first record can not be modified. I just want to empty grid,then fill using Dataset's data! // int TotalCounts=(this.grid.BindingContext[this.grid.DataSource,this.grid.DataMember]).Count; for(int i=0;i

Administrator [Syncfusion]
Replied On August 1, 2003 01:52 AM

Are you trying to move data from a table in 1 dataset to another table using the grid? Or, do you just want to display information from this other dataset in the grid. If it is the second thing you want to do, then try just setting grid.DataSource to the table you want to see. (There is no need to physically remove the rows from the first table.) If you really do wnat to remove the rows from teh first table, instead of that loop, try this: this.grid.CurrentCell.MoveTo(1,1); //home the current cell this.grid.Binder.RemoveRecords(0, TotalCounts-1); Then you could just set: this.grid.DataMember = ""; this.grid.DataSource = ds.Tables[0]; As far as your code, you might try adding grid.Binder.BeginEdit after your AddNew() but before you start setting the values.


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