Reputation: 12842
I want to hide a column of GridView based on a condition. How can I access the column in C# code?
if() // condition
{
// Disable code here. ?????
}
Thanks in advance.
Upvotes: 0
Views: 1118
Reputation: 346
Yes Akhtar You are correct.
grdUsers.Columns[0].Visible = false;
This code remove first column of gridview on displaying side.
Upvotes: 1
Reputation: 52241
Very simple man..
Grid.Columns[columnIndex].Visible = false;
Upvotes: 2