Need to change datagrid cell values programatically

On the Mouse Up event, I ask the user if they want to automatically update the values in this row.  If they say yes, I want to change various cell values and display those changes in the grid.
I assume I have to change the table and refresh the grid.  I am not getting any errors but I don't see the updates in the grid.  My dataset contains 3 tables.  The last one is the one bound to the datagrid.  Here is my code.

If Result = DialogResult.Yes Then
                Dim intRow As Integer = DataGrid1.CurrentRowIndex
                DsReqUpd14.Tables(2).Rows(intRow)(2) = Date.Today.ToString()
                DataGrid1.Refresh()
 End If
RuthD2004Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kGeniusCommented:
Your code doesn't accept the changes.

This should be your code (I thought, haven't checked it)

If Result = DialogResult.Yes Then
                Dim intRow As Integer = DataGrid1.CurrentRowIndex
                DsReqUpd14.Tables(2).Rows(intRow)(2) = Date.Today.ToString()
               
                'AcceptChanges, accept the changes !!
                DsReqUpd14.AcceptChanges()
               
                DataGrid1.Refresh()
 End If

Hope it 'll help
kGenius
0
eozz_2000Commented:
Or you can do this:

me.DataGrid1.Item(me.DataGrid1.CurrentRowIndex, here_the_number_of_the_column)

in here_the_number_of_the_column you can put the column number of the columns that you want to change its value:

me.DataGrid1.Item(me.DataGrid1.CurrentRowIndex, 0) = "Hello"
me.DataGrid1.Item(me.DataGrid1.CurrentRowIndex, 1) = "Bye"

in this code you will put the values "Hello" and "Bye" in the cell that you wanted, and then you can update your table.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.