Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2715
2 set of columns in an iggrid
posted

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?

Parents
No Data
Reply
  • 7499
    posted

    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)

Children