how to Hide column in data table c#?
thanks and reagds
sharad gupta
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted May 30, 2014, 6:07 AM
Abhishek KumarPosted May 30, 2014, 1:14 AM
DataTable dt = new DataTable();
dt.Columns.Add("CustomerID");
dt.Columns.Add("FirstName");
dt.Columns.Add("Amount");
dt.Rows.Add("0001", "Abhishek", 10000);
dt.Rows.Add("0002", "Ram", 20000);
dt.Rows.Add("0003", "Alice", 30000);
dt.Rows.Add("0004", "David", 40000);
Gridview1.DataSource = dt;
Gridview1.DataBind();
Gridview1.Columns["Amount"].Visible = false;
Hope this helps.
Lakshmanan Sethu SankaranarayanPosted May 30, 2014, 12:47 AM