earlier my code was on <asp:Button
and now i place code this code on one
<asp:ImageButton
it giving expected result ,I think problem may be that of button which i have place in panel,this panel I am using like that of chat box on FB.And that imagebutton i am using is on aspx page,my function is finely working on this image button.
this time i have use
rowcreated
event instead of
rowdatabound
event and writen this
GridView grvAd = (GridView)sender;
if (e.Row.RowType == DataControlRowType.Header)
{
for (int i = 0; i <= chklstSelectCol.Items.Count - 1; i++)
{
if (chklstSelectCol.Items[i].Selected == false)
grvAd.Columns[i].Visible =false;
else
{
grvAd.Columns[i].HeaderStyle.CssClass = "";
grvAd.Columns[i].Visible = true;
}
}
}
thank you guys,truly appreciate your help.