my one of the column in a page is
<asp:BoundColumn DataField="NotificationList" SortExpression="NotificationList" HeaderText="NotificationList">asp:BoundColumn>
if user is admin i want to make this column visible else it should not be visible
in code behind,I have handled for SAVE button in Page_load
if (this.UserIsAdmin())
{
this.btnSave.Visible = true;
}
else
{
this.btnSave.Visible = false;
}
but i dont know how to do it for column "NotificationList".
Loading
kiran kumarPosted Feb 18, 2010, 11:21 AM
this.gridview1.Columns[int index].Visible = false;
//in the above line index refers to your notification list column number
CHECK THE ANSWER IF IT HELPS YOU(PUT A MARK IN THE CHECKBOX)