Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
i got this error in my code which is red here this error is generate from last 3 days i can't understand wt happen plz help me.
<script runat="server">
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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();
[B] this.sqldsCustomerDetails.SelectParameters.Add("ID", Convert.ToString(this.gvCustomers.DataKeys[row.RowIndex].Value));[/B]
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();
}
</script>