Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value of a field in a gridview when updating after change

Status
Not open for further replies.

mcadphd

Programmer
Oct 20, 2011
4
US
I have a grid, when I select edit, I have one dropdown box that can be changed. After the change I need to get the Id field of that record. That field is hidden and readonly. I tried the datakeys but didnt work. Thanks

This code gets me the changed value
strQty = CType(gridShoppingCart.Rows(e.RowIndex).FindControl("drpQtyList"), DropDownList).Text

But I need the id of the record so I can pass to stored procedure to update the Qty Field for the record.

Again Thank you
 
Not sure if this is what your mean??

Code:
        Dim row As DataGridViewRow = Datagridview1.CurrentRow
        Dim RowID As Integer = row.Cells("ID").value


 
If you are referring to the value of the dropdown box in the grid:
Code:
Division = dgDetail.Item(dcDivision.Index, x).Value

--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top