gridView / Update

J

Just Me

Im struggling a bit with the update function.

I have bound a table with lets say 5 records ( 4 columns ) to the gridview ,
this displays jsut fine. I have added edit/cancel/update buttons in a
column which duly fire the relevent events, I have handled the edit and
canel events OK, but Im having problem with the row_updated event.

I thought I would be able to get the new values

e.newvalues.item(Columnindex)


And assign this to the relevent value in the table, and then call the sql
update on the table adapter, but I cant even get this far. Botht the
newValues and oldValues return a keys count of zero


Any help would be appreciated, when I used to use the old dataGrid it was
e.item(index).cells(index) and this worked ok.

Thanks In Advance - JM
 
G

Guest

Im struggling a bit with the update function.

I have bound a table with lets say 5 records ( 4 columns ) to the gridview ,
this displays jsut fine. I have added edit/cancel/update buttons in a
column which duly fire the relevent events, I have handled the edit and
canel events OK, but Im having problem with the row_updated event.

I thought I would be able to get the new values

e.newvalues.item(Columnindex)

And assign this to the relevent value in the table, and then call the sql
update on the table adapter, but I cant even get this far. Botht the
newValues and oldValues return a keys count of zero

Any help would be appreciated, when I used to use the old dataGrid it was
e.item(index).cells(index) and this worked ok.

Thanks In Advance - JM

e.Item.Cells(Columnindex).Controls(0) should give you the value

Dim CurrentTextBox As TextBox
CurrentTextBox = E.Item.Cells(Columnindex).Controls(0)
Dim ColValue As String = CurrentTextBox.Text
 
J

Just Me

No, this WAS the case for DataGrid in 1.x but for gridView, this property
does not exists.
 
G

Guest

No, this WAS the case for DataGrid in 1.x but for gridView, this property
does not exists.

My apologies, I misread your post.

I have no code, but I found that the one possible reason is that there
is no an ASP.NET data source control.

The GridView control passes values to the data source for an update or
delete operation in three dictionary collections: the Keys dictionary,
the NewValues dictionary, and the OldValues dictionary.

Take a look here,
http://www.velocityreviews.com/forums/t117771-gridview-empty-oldvalues-newvalues.html

How a Data Source Control Creates Parameters for Data-bound Fields
http://msdn2.microsoft.com/en-us/library/ms228051(VS.80).aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top