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

add records after remove records

Thread ID:





6125 Jul 31,2003 11:30 PM UTC Aug 1,2003 05:52 AM UTC WinForms 1
Tags: GridControl
Asked On July 31, 2003 11:30 PM UTC

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 05:52 AM UTC

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.

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