Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 5:      Protected Sub TeamDetailsGridView_Databound(ByVal sender As Object, ByVal e As System.EventArgs) _
Line 6:            Handles TeamDetailsGridView.DataBound
Line 7:          TeamDetailsGridView.Rows(10).Cells(0).BackColor = Drawing.Color.DarkGray
Line 8:          TeamDetailsGridView.Rows(10).Cells(1).BackColor = Drawing.Color.DarkGray
Line 9:          TeamDetailsGridView.Rows(10).Cells(2).BackColor = Drawing.Color.DarkGray

Source File: E:\web\leosgolf\GolferTeams.aspx.vb    Line: 7

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.ArrayList.get_Item(Int32 index) +12906457
   System.Web.UI.WebControls.GridViewRowCollection.get_Item(Int32 index) +15
   GolferTeams.TeamDetailsGridView_Databound(Object sender, EventArgs e) in E:\web\leosgolf\GolferTeams.aspx.vb:7
   System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +109
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +165
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   System.Web.UI.WebControls.GridView.DataBind() +10
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +76
   System.Web.UI.Control.EnsureChildControls() +97
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0