Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi please urgently

Is there a way to let the user select a gridview row by clicking anywhere in the row(only a single row).

Here i'm use code as
protected void Table_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.aview, "Select$" + e.Row.RowIndex);
            e.Row.Style.Add("cursor", "pointer");
         }
   }

Is there any other code possible? plz Send Me

Thanks in advance
Posted
Updated 20-Dec-10 10:24am
v3
Comments
Toniyo Jackson 20-Dec-10 5:04am    
Always write your code in code block.
Sandeep Mewara 20-Dec-10 5:09am    
Whats the issue with the above code? What exactly you are looking for?
Toli Cuturicu 20-Dec-10 16:24pm    
If it is a web project, why can't you specify it in the TAGS?!

1 solution

Hi,

What you can try is set the GridViews Selection-Mode Property to FullRowSelect...
 
Share this answer
 
Comments
Toniyo Jackson 20-Dec-10 5:27am    
hello... Its not win forms. Its web application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900