This question is locked. New answers and comments are not allowed.
Hi,
I am using a grid on my application to display a list of attachments. Every one can see this list. Only an administrator is allowed to add new attachments, and for this add button I would use the following code to display this add button:
.ToolBar(commands => commands.Custom().Text("Add New Attachment").Action("CreateAttachment", "Application"))
Now the tricky part is that only the administrator can see this button, the rest cannot see it. I have a base controller class that determines if the logged on user is an administator or not. I also created a helper class for this to be used in the view like:
<% if (Html.IsAdministrator()) {} %>
How would I put an if in my grid to display the toolbar if it is an administrator and to hide it if it is not an administrator? Is this in any way possible?
Thanks
Brendan
I am using a grid on my application to display a list of attachments. Every one can see this list. Only an administrator is allowed to add new attachments, and for this add button I would use the following code to display this add button:
.ToolBar(commands => commands.Custom().Text("Add New Attachment").Action("CreateAttachment", "Application"))
Now the tricky part is that only the administrator can see this button, the rest cannot see it. I have a base controller class that determines if the logged on user is an administator or not. I also created a helper class for this to be used in the view like:
<% if (Html.IsAdministrator()) {} %>
How would I put an if in my grid to display the toolbar if it is an administrator and to hide it if it is not an administrator? Is this in any way possible?
Thanks
Brendan