user1512593 user1512593 - 1 year ago 91
ASP.NET (C#) Question

hiding the Select button in gridview

I currently have a gridview that allows you to select the row by clicking anywhere on that row. however, there is a problem. The AutoGenerateSelectButton must be set to true. This means that the select button is now visible and part of the grid view. I wanted to know if there was a way to hide it without disrupting the grid size?

Answer Source

Have you considered hiding the column with CSS? This can be done in the RowDataBound event:

protected void yourGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    e.Row.Cells[0].Style["display"] = "none";
    // or e.Row.Cells[0].CssClass = "hidden-cell";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download