How to remove Particular column in Gridview.. [Resolved]

Posted by Oswaldlily under ASP.NET on 3/12/2013 | Points: 10 | Views : 2335 | Status : [Member] | Replies : 1
How to remove Particular column in Gridview..
I dont want to Hide or set visible=false.
I need to completely remove it..




Responses

Posted by: Jayakumars on: 3/12/2013 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
hi
try this code

GridView gv=new GridView() ;

foreach (DataColumn column in ds.Tables[0].Columns)
{
BoundField field = new BoundField();
field.DataField = column.ColumnName;
field.HeaderText = column.ColumnName;
gv.Columns.RemoveAt(0);
}

Mark as Answer if its helpful to you

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response