Live Chat Icon For mobile
Live Chat Icon

How to hide and show a Column based on the authenticated user

Platform: ASP.NET| Category: DataGrid

In the DataGrid_ItemDataBound Event write the following code

VB.NET


If Not User.Identity.IsAuthenticated Then
   	e.Item.Cells(1).Visible = False
End If

C#


if ( ! User.Identity.IsAuthenticated )
{
	 e.Item.Cells[1].Visible =false;
}

Share with

Share on twitter
Share on facebook
Share on linkedin