I have a gridview of employee jobs. One job row gets selected and some items from the row and some items from the database populate a space below the Gridview on an aspx page. total hours is in the gridview row. The user enters the payrate into one of the fields on the aspx page. user enters another field for overtime rate. There is a DropdownList that has hourly and Hourly+. Stakeholder does not want the total hours displayed below the gridview.
The problem is I don't know how to locate the row that was selected from the Gridview.
It is not the opject that is firing the current event.
// Get the currently selected row. Because the SelectedIndexChanging event
// occurs before the select operation in the GridView control, the
// SelectedRow property cannot be used. Instead, use the Rows collection
// and the NewSelectedIndex property of the e argument passed to this
// event handler.
GridViewRow row = CustomersGridView.Rows[e.NewSelectedIndex];
// You can cancel the select operation by using the Cancel
// property. For this example, if the user selects a customer with
// the ID "ANATR", the select operation is canceled and an error message
// is displayed.
if (row.Cells.Text == "ANATR")
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
selectcommand="SELECT CustomerID, FirstName, MiddleName, LastName, Phone FROM SalesLT.Customer"
connectionstring="<%$ ConnectionStrings:AdventureWorksLTConnectionString %>"
Last Visit: 31-Dec-99 18:00 Last Update: 29-Jul-15 6:01