Home All Groups Group Topic Archive Search About

Editing a DataGridView bound to a DataView

Author
5 Jan 2007 4:48 AM
ME
I have an application that displays data in a DataGridView.  The data is in
a DataView that is sorted and at times filtered.  One of the columns I have
in the dataview is a boolean field called "selected".  Typically the
DataView will either be sorted or filtered by this column.  However when the
user toggles the row value for this column (and others as well) in the
DataGridView  and ends the edit the data in the dataview changes, causing
the filter or sort to reapply.  This gets aggravating when the user goes to
select what "was" the row below or above and suddenly it is a second row
away.  If a filter is applied the row they just modified may even be
filtered out now and longer visible.  It causes multiple data entry mistakes
as well.

I would like to be able to allow the user to modify the data in the grid
while displaying their chosen dataview as there are several records to work
with.  What is the proper way to handle this type of problem?  How can I
make the DataGridView NOT AcceptChanges on the dataset (I think this may be
the way to work around the issue) but still modify the row values?

Thanks,

Matt

AddThis Social Bookmark Button