I need 2 set of columns layout in an iggrid i a mvc view
I have 2 diffent set of users
one need all colums the other need only a subset of columns
how do I set this up?
Hello Christian,
You can get the user name in the view as suggested in the following forum thread verified answer
“If you need to get the user from within the controller, use the User property of Controller. If you need it from the view, I would populate what you specifically need in the ViewData, or you could just call User as I think it's a property of ViewPage.”
http://stackoverflow.com/questions/263486/how-to-get-current-user-in-asp-net-mvc
Once you get the user name you can the define the column definition the needs to be hidden for the second user like below:
.ColumnFor(....).Hidden(ViewPage.User === "user2" ? true : false)
What about RowTemplate
it has to match the columns