1. On Saturday September 3RD, 2016 this community will be shutdown permanently.

    The time has come to close this community. I no longer have any interest in Visual Studio programming and my efforts to find someone to take over the community has failed.

    If anyone is interested in acquiring the database contact me and I will make it available for you.

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
    Messages:
    2
    Likes Received:
    0
    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 (Text):
    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

     
     
  2. Couly

    Couly New Member

    Joined:
    Jan 26, 2012
    Messages:
    2
    Likes Received:
    0
    Location:
    Dublin
    ok thanks
     

Share This Page