I am attempting to select a specific row in my grid in the ItemCreated event handler and am getting an "ArgumentOutOfRangeException" when the selection code is executed.
Following is my code:
I don't seem to run into any problems with the if statement being evaluated properly on line 7 because it enters the if statement without issue. I get the error when it attempts to set the selected attribute to true on line 8. I must be missing something...any help would be appreciated.
Regards,
Kenyon
Following is my code:
| Protected Sub radGridProspects_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radGridProspects.ItemCreated | |
| If TypeOf e.Item Is GridDataItem Then | |
| Dim editLink As HyperLink = DirectCast(e.Item.FindControl("EditLink"), HyperLink) | |
| editLink.Attributes("href") = "#" | |
| editLink.Attributes("onclick") = [String].Format("return ShowEditProspectWindow('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ProspectID"), e.Item.ItemIndex) | |
| If e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ProspectID") = Session("ProspectID") Then | |
| e.Item.Selected = True | |
| End If | |
| End If | |
| End Sub |
I don't seem to run into any problems with the if statement being evaluated properly on line 7 because it enters the if statement without issue. I get the error when it attempts to set the selected attribute to true on line 8. I must be missing something...any help would be appreciated.
Regards,
Kenyon