protected void BtnViewDetails_Click(object sender, EventArgs e) { // get the gridviewrow from the sender so we can get the datakey we need Button btnDetails = sender as Button; GridViewRow row = (GridViewRow)btnDetails.NamingContainer; // extract the customerid from the row whose details button originated the postback. // grab the customerid and feed it to the customer details datasource // finally, rebind the detailview this.sqldsCustomerDetails.SelectParameters.Clear(); this.sqldsCustomerDetails.SelectParameters.Add("customerid", Convert.ToString(this.gvCustomers.DataKeys[row.RowIndex].Value)); this.dvCustomerDetail.DataSource = this.sqldsCustomerDetails; this.dvCustomerDetail.DataBind(); // update the contents in the detail panel this.updPnlCustomerDetail.Update(); // show the modal popup this.mdlPopup.Show(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)