Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While I Update GridView, I get the error as

Specified argument was out of the range of valid values.
Parameter name: index


The code when the debugger breaks is

HTML
bid = CType((gvBuilding.Rows(e.RowIndex).Cells(1).Controls(0)), TextBox).Text
Posted

1 solution

Using debugger, check the value of e.RowIndex, is it out of bounds? If not what about Cells etc.
 
Share this answer
 
Comments
Kishore Jangid 4-Sep-11 14:48pm    
EveryThing is Correct but still the problem persists
Wendelius 4-Sep-11 14:56pm    
Few questions. If you set a breakpoint to that row and using the watches check:
- what is gvBuilding.Rows.Count ?
- what is e.RowIndex ?
- what is gvBuilding.Rows(e.RowIndex).Cells.Count ?
- what is gvBuilding.Rows(e.RowIndex).Cells(1).Controls.Count ?
Kishore Jangid 4-Sep-11 15:10pm    
60
5
1
Kishore Jangid 4-Sep-11 15:14pm    
actually the problem was i wrote the BindData() Sub after the update is completed
Wendelius 4-Sep-11 15:22pm    
Ok, so you got it solved?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900