The only line that I know can cause that Exception is the FindControl of the Label. In particular, the Controls(0). The Exception means element 0 wasn't found. In other words, there is nothing inside GridManager1.
What is GridManager1? If it is a GridView, that code never worked anyway, since GridView is made up of Rows, and there are no Controls findable directly on the GridView itself.
When is setNumberRecord called? If it can happen before DataBind, that would explain.
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
superguppie
All-Star
48225 Points
8679 Posts
Re: ArgumentOutofRangeException when loading GridView
Feb 27, 2012 02:43 PM|LINK
The only line that I know can cause that Exception is the FindControl of the Label. In particular, the Controls(0). The Exception means element 0 wasn't found. In other words, there is nothing inside GridManager1.
What is GridManager1? If it is a GridView, that code never worked anyway, since GridView is made up of Rows, and there are no Controls findable directly on the GridView itself.
When is setNumberRecord called? If it can happen before DataBind, that would explain.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.