Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Dim StrOpt = IIf(IsDBNull(EGDs.Tables(0).Rows(0)("OptionalFeatures")), 0, EGDs.Tables(0).Rows(0)("OptionalFeatures"))
           Dim str As String() = StrOpt.Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries)
           For i As Integer = 0 To str.Length - 1
               For j As Integer = 0 To GrdOpFeatures.Rows.Count - 1
                   If GrdOpFeatures.DataKeys(j).Value().ToString() = str(i).ToString() Then
                       'CType(GrdElvBuildGrp.Rows(j).FindControl("ChkOpt"), CheckBox).Checked = True
                       'Dim chk As CheckBox = DirectCast(GrdElvBuildGrp.Rows(j).FindControl("ChkOpt"), CheckBox)
                       Dim chk As CheckBox = CType(GrdElvBuildGrp.Rows(j).FindControl("ChkOpt"), CheckBox)
                       chk.Checked = True
                   End If
               Next
           Next




error :

SQL
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Posted
Comments
Debug and see where exactly it is throwing the error. Then you easily find the problem.

1 solution

Please check there is any row exists inside GrdElvBuildGrp jth position
 
Share this answer
 

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