Hi,all
How to Hide automatically generated column in GridView in C#? any property is there?plz tell me.
Thanx in Advance
himanshu
Hide automatically generated column in GridView in C# ?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Master BillaRank #2,229 · 630 reputationPosted Sep 1, 2009, 6:54 AM EDT
You can do this way also
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.Columns[0].Width= 0;
}
thank you
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Sep 1, 2009, 2:12 AM EDT
{
if (e.Row.Cells.Count >= 1)
e.Row.Cells[1].Visible = false;
}
Assuming you want to hide the second column in your automatically generated GridView.
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 1, 2009, 4:44 AM EDT
Here is What you want .
dont forget to mark "Do you like answer" please it will give me some credits :)
private void Form1_Load(object sender, EventArgs e)
{
//Code For Filling the DataGridView from database
// Code For Hiding Columns Youwant
//Suppose you want to hide column 2 and 3
dataGridView1.Columns[1].Visible = false;
dataGridView1.Columns[2].Visible = false ;
}