gridView / Update

  • Thread starter Thread starter Just Me
  • Start date Start date
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
 
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
 
No, this WAS the case for DataGrid in 1.x but for gridView, this property
does not exists.
 
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
 
Back
Top