I am just wondering how to access the cell value for the row updating (event = Gridview.
To String Message="Conversion from string "Location Name" to type 'Integer' is not valid." I would prefer to get the cells by name rather then by location e.g. Keys is an array of all the data keys you define for the gridview (Data Key Names="id", where "id" is the field name from your database query) e. Old Values are arrays of all the fields in the gridview data source that are NOT leys, where, as you might guess, e.
You access the values stored in the event by index or name: e. So, to update, you might set the parameters as id = e. of course, if I have 20 columns I could define 20 data keys but I just wondered if there is another way instead of: Sql Data Source Locations.
PS: location name is not an integer You don't access the table cells by name. So, basically, instead of looking for table cells, look for the appropriate e. New Values Hi mckrecker, thanks for your reply but I dont need to differ between old and new values since I set a datakey which is the unique ID in my db and I update where unique ID = @unique IDselected of column.
A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.
Row Updating Dim select Row As Grid View Row = Grid View Wn.
New Values -- it will have all the values, as does e. There are two in that event so data source controls can differnitate bewteen the two.
I just need to get it working with the "real" one from the gridview row Sql Data Source Locations. Add("Location Name Update", Type Code.[String], "dd") Dim select Row As Grid View Row = Grid View Locations.
event is raised when a row's Update button is clicked, but before the Grid View control updates the row.
This enables you to provide an event-handling method that performs a custom routine, such as canceling the update operation, whenever this event occurs.
I just tested that Protected Sub Wr_Updated(By Val sender As Object, By Val e As System. how strange, the same thing worked perfectly on a different site: the sql part works...