Hi Parveen:
Thanks for the kind words. By default, if you bind the grid to the
dataview, than any and all changes you make in the grid will pass through to
the view which pass through to the datatable. So editing the DataView is
editing the datatable and once the grid is bound to it, than any and all
changes will be reflected in the datatable. When you are done, you can just
call update on your adapter passing in the datatable that the view is based
on. The short of it is that you really don't have to do anything different.
Also, you need to end the current edit for a row's state to be changed, but
by clicking a button or menu item, this will happen by default so you really
don't need to do anything else. If you were editing textboxes you'd want to
call EndCurrentEdit of the bindingcontext right before the call to update,
but that shouldn't be necessary based on the scenario you describe here.
Just make sure you don't call .AcceptChanges before update as that will
ensure that the chnages in the view won't ever be sent back to the db...and
Update calls acceptChanges on a row by row basis as it updates anything.
HTH,
Bill
--
W.G. Ryan MVP Windows - Embedded
www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
"Parveen" <(E-Mail Removed)> wrote in message
news:2070BA56-2A4F-474D-ACB1-(E-Mail Removed)...
> Thanks! I read your article...it's helpful...one more question
> though...I have a grid bound to my datatable and i want to sort
> and edit the datatable...i know i can get a sorted version of the
> datatable through using a view but what about the changes? My
> changes are based on the sort order of the table and I want these
> changes to show up in the grid after I've made them. Is it possible
> to edit the view and then save these changes back to the datatable?
>
> Parveen