1
Answer

how to dynamically delete a column from a gridview

Shreyas Jain

Shreyas Jain

10y
990
1
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)