Selecting a row on a gridview with delete button

Discussion in 'ASP.NET' started by Couly, Jan 26, 2012.

  1. Couly

    Couly New Member

    Joined:
    Jan 26, 2012
    Location:
    Dublin
    Hi,
    I have a gridview which I can hover over the rows, and the background changes colour which is great. I also allow the user to choose a row by clicking on the gridview and moving to the next page. This works great, but if I want to delete a row, it 'Selects' the row instead. Can anyone help? I have posted this code below:

    Code:
    If e.Row.RowType = DataControlRowType.DataRow Then
    e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand'; this.style.backgroundColor='YellowGreen';")
    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';")
    e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" + e.Row.RowIndex.ToString))
    
    End If
    
    
     
    #1
  2. Couly

    Couly New Member

    Joined:
    Jan 26, 2012
    Location:
    Dublin
    ok thanks
     
    #2

Share This Page