Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to hide one column from grid..plz help?
Posted
Comments
ZurdoDev 25-Jun-12 8:57am    
Set Visible = false.

Try this:
C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells[0].Visible = false;
    }


Have a look on this CP article:
Show / Hide GridView Columns in ASP.NET[^]
This article demonstrates how to give users the ability to show or hide GridView columns as they require.
 
Share this answer
 
v2
Comments
sandeep nagabhairava 25-Jun-12 9:36am    
hi prasad take my 5!
:)
Prasad_Kulkarni 25-Jun-12 9:37am    
yupp catched it!
Rahul Rajat Singh 25-Jun-12 11:26am    
good answer. +5.
Prasad_Kulkarni 25-Jun-12 23:52pm    
Thank you Rahul!
C#
GridView.Columns[column].Visible = false
 
Share this answer
 

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