Home » FAQ » ASP.NET » DataGrid » How to hide and show a Column based on the authenticated user
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; }
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with