开发者

how to hide GridView column when data is accessed dynamically in gridview

hii

I have 2 gridviews they are bind by sqldatasource ,it contains Id , Name and Price

i dont want to show ID coloumn when page is loaded.How to开发者_StackOverflow中文版 hide it?


Add Visible="false" to the column declaration, or in code.


 protected void gvDocuments_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[1].Visible = false;
        }


You can also hide the column from the code where you feel like.

this.DataGridView1.Columns["ID coloumn"].Visible = false;

Regards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜