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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Data from older Dataset lurking around... :(

Thread ID:

Created:

Updated:

Platform:

Replies:

34195 Sep 6,2005 09:15 AM UTC Sep 8,2005 08:05 AM UTC WinForms 6
loading
Tags: GridControl
Salil Khedkar
Asked On September 6, 2005 09:15 AM UTC

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();

Salil Khedkar
Replied On 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();

Administrator [Syncfusion]
Replied On 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

Salil Khedkar
Replied On 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

Salil Khedkar
Replied On 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 >

Salil Khedkar
Replied On 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. :)

CONFIRMATION

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

or the page will be automatically redirected to 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

;