For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > July 2006 > Re: Deleting row from GridView causes ArgumentOutOfRangeException during System.Web.U









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Deleting row from GridView causes ArgumentOutOfRangeException during System.Web.U
Jan Hyde

2006-07-04, 8:00 am

"loga123" <vdevarakonda@covansys.com>'s wild thoughts were
released on 29 Jun 2006 09:58:26 -0700 bearing the following
fruit:

>Hi All,
>
>I am using Link Button for DELETE on the gridview. When I click on
>DELETE link, I get the ArgumentOutOfRangeException. But...it deletes
>the record from table in the database.
>On Gridview_rowdatabound, I am dynamically building hyperlink control
>based on the values in the other fields. Here is my code for
>Gridview_rowdatabound. It does work sometimes though.
>
>
> Protected Sub dgQuestions_RowDataBound(ByVal sender As Object, ByVal e
>
>As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
>dgQuestions.RowDataBound
>
>
> If e.Row.RowType = DataControlRowType.DataRow Then
>
>
> Dim hLnk As HyperLink = CType(e.Row.Cells(3).Controls(0),
>HyperLink)
>
>
> Dim iCID As String
> iCID = drpClasses.SelectedValue
>
>
> Dim iQSeq As Integer
> iQ = cint(e.Row.Cells(1).Text)
> hLnk.NavigateUrl = "ShowDetails.aspx?CID=" & iCID
>
>
> End If
> End Sub
>


Is that your real code?

Because you declare 'iQSeq' but us 'iQ'


Jan Hyde (VB MVP)

--
Why don't boxers have sex before a fight?

Because they don't fancy each other.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com