Dear All,
I’m setting the visibility of the command item (Hyper Link)in the command item template (Add New Record) on the grid pre render event based on logged in user permissions.
The code used is shown below:
foreach (GridItem Item in grdUsers.MasterTableView.GetItems(GridItemType.CommandItem)) |
{ |
GridCommandItem CommandItem = (GridCommandItem)Item; |
LinkButton InitLinkButton = (LinkButton)CommandItem.FindControl(functionalitiesRow.ControlName); |
if (InitLinkButton != null) |
{ |
InitLinkButton.Visible = false; |
break; |
} |
} //End for each |
The problem is that when I do reordering for the column on the server side the code in grid pre render even is executed and the Hyper Link visibility is set to false but when the page appears the (Add New Record) hyper link is visible to the user and s/he can click on it.
This problem only appears on the reordering columns functionality.
I don’t want to reorder the column on client side, because am preserving the grid state and columns order for the logged in user.
Any suggests to my problem?