Shreyas Jain

Shreyas Jain

  • NA
  • 15
  • 11.7k

how to dynamically delete a column from a gridview

Mar 28 2014 9:07 AM
when the user selects an option from a dropdownlist ie ACTIVE . i want that column 11 of gridview should be visible=false
this code is Not working when there are no records in a gridview.
 
if (ddlstatus.SelectedValue == "ACTIVE")       //dropdownlist value change
{
lablestatus.Text = "ACTIVE USERS";
//e.Row.Cells[10].Visible = false;    
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnk = (LinkButton)(e.Row.FindControl("lbaccept"));
lnk.Text = "Block";
lnk.CommandName = "Blocked";
}
}


Thanks 

Answers (1)