When a user selects a row on my grid and clicks the button, it is meant to update the value of one of the columns by inserting a string to the database based on the selection.
However, the button causes a postback so the state of the grid's selected row value is lost.
My parameter comes back with an out of bounds error despite the grid looking checked on the running form:
ClientId.Value = grdClient.SelectedItems(0).OwnerTableView.DataKeyValues(grdClient.SelectedItems(0).ItemIndex)("iClientId")
How can I preserve the selected state of the grid so the client id selected value can be passed to the parameter after the button's postback?