468,301 Members | 1,499 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

Data grid inserting value using code

Jim
I have a datagrid on a windows form that is filled using a data adapter and
dataset created in code. I have mapped columns to the various fields. The
user enters new infromation into the grid and then clicks a save button on
the toolbar to save the updated or new data. Two questions:

1. How do I let the user move directly from the row of newly inserted data
to the button and get the data to save. HasChanges does not recoginize the
row has changes unless we click in another row first.

2. I want to insert a specific value into one of the columns to be saved
with the changed column(s). I also need to know which row has the changes.

How do I accomplish this in vb.NET?

Thanks,
--
Jim
Nov 21 '05 #1
1 1096

1. How do I let the user move directly from the row of newly inserted data
to the button and get the data to save. HasChanges does not recoginize the
row has changes unless we click in another row first.
Probably one of the most asked questions in the dotNet newsgroups.
\\\as sample
BindingContext(ds.Tables(0)).EndCurrentEdit()
///
Before the test on haschanges by instance
2. I want to insert a specific value into one of the columns to be saved
with the changed column(s). I also need to know which row has the changes.

How do I accomplish this in vb.NET?


Every datarow has a rowstate, however you have to find those row while
looping throught the dataset.

http://msdn.microsoft.com/library/de...statetopic.asp

I hope this helps?

Cor
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by pmud | last post: by
12 posts views Thread by pmud | last post: by
3 posts views Thread by pmud | last post: by
2 posts views Thread by Parveen | last post: by
reply views Thread by Gian Paolo | last post: by
9 posts views Thread by Anil Gupte | last post: by
6 posts views Thread by insirawali | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.