简体   繁体   中英

dynamically Hide or visible false gridview Auto generated columns in asp.net in code behind?

I am trying to visible false for Autogenerated columns in

 mygrid.Columns[0].Visible = false  

When I have used Above code that is 'Hiding Actual data column' in My database table data false But I want visible false Autogenerated select and autogerated delete buttons.

Gridview1.AutogeneratedColumns.visible =false;

this Property is not their in Vs could please help me.

为了显示和隐藏Cell控件,您必须跟踪GridView的RowDataBound事件。

This is right code :

  Gridview1.AutogeneratedColumns=false

Gridview.AutogeneratedColumns

Gets or sets a value indicating whether bound fields are automatically created for each field in the data source.

More information : http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.autogeneratecolumns(v=vs.110).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM