-
Nov 14th, 2013, 12:56 PM
#1
Thread Starter
Frenzied Member
DataGridView Not Assuming All Changes
Hi
I have a problem with a form that has 4 datagridviews, every datagridview has is own datasource (datatables), the user can change everything in the datagrids, at any point the user can select SAVE and all the datasources are updated (table adapters with my own sp's), or that was what was supposed to happen...
After some tests i noticed that some cells doesn't are saved....
For example i have several combos in the datagrids, the UI shows the value that the user selected, but when saving it assumes the original value or nothing... Kind of the value wasn't committed by the control, but this happens in normal text cells...
Before saving i call the end edit for each datagrid, and select another control in the form just to ensure that none of the datagrids are selected.
What i'm missing here?
I recall reading somewhere that the rows in the datagridview can have a intermediary state... but i don't know where i read that....
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Nov 15th, 2013, 12:29 AM
#2
Re: DataGridView Not Assuming All Changes
Hi,
I know that you have said that you have called EndEdit on the DataGridView but I am not sure if that has the same affect as calling EndEdit on the BindingSource which Ensures that all pending changes are flushed to the underlying DataSource in the project. Have a look here:-
BindingSource.EndEdit Method
Hope that helps.
Cheers,
Ian
-
Nov 15th, 2013, 06:19 AM
#3
Thread Starter
Frenzied Member
Re: DataGridView Not Assuming All Changes
I dont use any binding source...
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Nov 15th, 2013, 08:37 AM
#4
Re: DataGridView Not Assuming All Changes
Hi,
I would guess then that this is the potential issue.
I would recommend adding a BindingSource between each DataTable and DataGridView and then set the DataGridView's DataSource to each BindingSource. Once done, you can then call EndEdit on each BindingSource rather than each DataGridView which I suspect will solve your intermittent issues.
Hope that helps.
Cheers,
Ian
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|