Please Help, I have User Control that contain GridView where i am hiding its Columns on GridView RowCreated event :
private void gvGrid_RowCreated(object sender, GridViewRowEventArgs e)
{
foreach (TableCell objCell in e.Row.Cells)
{
if (objCell is DataControlFieldHeaderCell)
{
objCell.Visible = false;
}
}
}
Now every thing was working fine, but On ASPX Page Postback ( containing Griview UserControl), shows all hidden columns, where my PageLoad is as follows
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ucGridView.PopulatePage();
}
}
Note : ASPX Page start working fine if i remove !IsPostBack Check..but i dont want this...Whats the Problem...!