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

Data from older Dataset lurking around... :(

I use a single data grid to show data belonging to different entities. I set the DataSource property of the grid to null and then to the new dataset as user switches between entities. The problem is - if an entity has a dataset with no rows, the grid still shows data from older dataset in some of the columns. Especially in the cell where user was editing. I tried doing all of the following before switching the dataset associated with the grid, but it did not help: Grid.CurrentCell.CancelEdit(); Grid.Binder.EndEdit(); Grid.CurrentCell.EndEdit(); Grid.DataSource = null; Grid.Refresh();

6 Replies


SK Salil Khedkar September 6, 2005 11:55 AM UTC

Thanks a lot for your reply Stanley. I tried the given examples. But the problem still persists. I made an observation that the problem only occurs when the DataSource is switched while the user editing a cell. I tried the following: .Binder.CancelEdit(); .CurrentCell.EndEdit(); .CurrentCell.Deactivate(false); .DataSource = null; .DataMember = null; .Model.ResetVolatileData(); .DataSource = dsDEEParams.TableJoin.Tables[0]; .Refresh(); .Model.ResetVolatileData(); .CurrentCell.Refresh(); .Refresh();


AD Administrator Syncfusion Team September 6, 2005 03:35 PM UTC

What is your user doing to indicate the data should be switched? Can you see the problem in this sample that switched empty datasources on a button click? Can you modify teh sample to show the problem? http://www.syncfusion.com/Support/user/uploads/GDBG_Switch_3231eee9.zip


SK Salil Khedkar September 8, 2005 05:41 AM UTC

Thanks a lot Clay, I will try your sample and will let you know the results. To answer you question: a. I have a wizard like interface where user can enter data related with the currently selected object. The user clicks ‘next’ button or selects another node in an ‘object list’ tree-view to switch the data source. The grid to view/edit the data is the same. Only the data source is changed as user switches the selected object (by selecting it in the tree-view or clicking the next button) b. I am using Syncfusion Essential Suite version 2.0.5.1


SK Salil Khedkar September 8, 2005 07:17 AM UTC

It''s weird but I can not repro the problem when I work with a standalone application like the example you had sent. The code is all the same as far as I see, but in my big fat complex app the problem persists and in the thin POC app everything works well. I am attaching my thin POC app, to show what I am doing. >What is your user doing to indicate the data should be switched? > >Can you see the problem in this sample that switched empty datasources on a button click? Can you modify teh sample to show the problem? > >http://www.syncfusion.com/Support/user/uploads/GDBG_Switch_3231eee9.zip >


SK Salil Khedkar September 8, 2005 08:05 AM UTC

Kudos Stanley and Clay: With your help + a bugfix in my code = the problem is no more. Basically CurrentCell.EndEdit() was required while the CurrentCell was still *valid*. When I was calling the EndEdit the CurrentCell was invalid so it had no effect. :)

Loader.
Live Chat Icon For mobile
Up arrow icon