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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted May 29, 2014, 8:47 PM EDT
Abhishek KumarRank #510 · 4.8K reputationPosted May 29, 2014, 9:14 PM EDT
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.
VulpesRank #55 · 29.2K reputationPosted May 30, 2014, 2:07 AM EDT