The GridView 'GridView2' fired event RowEditing which wasn't handl

Discussion in 'ASP .Net' started by egsdar, Nov 4, 2008.

  1. egsdar

    egsdar Guest

    Hi, I have created a second gridview when customer clicks on select link with
    this code:



    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
    GridView1.RowCommand

    Select Case e.CommandName

    Case "Select"

    GridView1.SelectedIndex = e.CommandArgument
    Dim index As Integer = Convert.ToInt32(e.CommandArgument)

    ' Retrieve the row that contains the button clicked
    ' by the user from the Rows collection.
    Dim row As GridViewRow = GridView1.Rows(index)
    Dim mival = Server.HtmlDecode(row.Cells(1).Text)
    HiddenField1.Value = mival
    TabContainer1.Visible = True
    Dim sqlConn As System.Data.SqlClient.SqlConnection
    Dim sqlCmd As System.Data.SqlClient.SqlCommand
    Dim strConnection As String
    strConnection =
    ConfigurationManager.ConnectionStrings("SIPConnectionString").ConnectionString
    sqlConn = New
    System.Data.SqlClient.SqlConnection(strConnection)
    sqlCmd = New System.Data.SqlClient.SqlCommand("SELECT
    responsablepropuesta.respgrupo as IDRespGrupo, tb1.nombre as RespGrupo,
    responsablepropuesta.resppropuesta as IDRespProp, tb2.nombre as RespPropuesta
    FROM responsablepropuesta INNER JOIN usuario tb1 ON tb1.idusuario =
    responsablepropuesta.respgrupo INNER JOIN usuario tb2 ON tb2.idusuario =
    responsablepropuesta.resppropuesta where idpropuesta='" & mival & "'",
    sqlConn)

    sqlConn.Open()
    GridView2.DataSource = sqlCmd.ExecuteReader()
    GridView2.DataBind()
    sqlConn.Close()
    End Select

    End Sub


    And when users tries to clicks on Edit link, runs this code:



    Protected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
    GridView2.RowCommand
    Select Case e.CommandName

    Case "Edit"

    GridView2.SelectedIndex = e.CommandArgument
    Dim index As Integer = Convert.ToInt32(e.CommandArgument)

    ' Retrieve the row that contains the button clicked
    ' by the user from the Rows collection.
    Dim row As GridViewRow = GridView2.Rows(index)
    Panel1.Visible = False
    Panel2.Visible = True

    End Select
    End Sub



    But when it finish this part, it displays an error:

    The GridView 'GridView2' fired event RowEditing which wasn't handled.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information about
    the error and where it originated in the code.

    Exception Details: System.Web.HttpException: The GridView 'GridView2' fired
    event RowEditing which wasn't handled.

    Source Error:



    An unhandled exception was generated during the execution of the current web
    request. Information regarding the origin and location of the exception can
    be identified using the exception stack trace below.



    Stack Trace:



    [HttpException (0x80004005): The GridView 'GridView2' fired event RowEditing
    which wasn't handled.]
    System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs e)
    +324
    System.Web.UI.WebControls.GridView.HandleEdit(Int32 rowIndex) +60
    System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean
    causesValidation, String validationGroup) +679
    System.Web.UI.WebControls.GridView.RaisePostBackEvent(String
    eventArgument) +213

    System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +32
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +242
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3822






    How can I solve this?
    egsdar, Nov 4, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen
    Replies:
    3
    Views:
    68,983
    JackMcKenzie
    Nov 1, 2007
  2. mani
    Replies:
    3
    Views:
    297
    Default User
    Nov 18, 2007
  3. rote
    Replies:
    0
    Views:
    1,742
  4. Vincent
    Replies:
    12
    Views:
    12,002
    Jerry Hui
    Mar 19, 2010
  5. Jason
    Replies:
    0
    Views:
    384
    Jason
    Oct 4, 2006
Loading...

Share This Page