locked
How can I hide data fields for AddandEditNew? RRS feed

  • Question

  • Hi all,

    I created two LS apps, one for my team users and one for our partners. The app for my team users can manage all the data fields through the app, and the app for our partners only can see and manage some data fields. But I add an auto generated AddandEditNew button, and the partners can edit and add the fields that I don't want them to see. So is there any way that I can hide the fields in the AddandEditNew page?

    PS: It is the Silverlight Client
    • Edited by ConnorTang Friday, March 28, 2014 5:52 PM
    Wednesday, March 26, 2014 9:50 PM

Answers

All replies

  • html or silverlight client?

    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Thursday, March 27, 2014 7:15 AM
  • If it is HTML then I have a sample here:

    LightSwitch HTML client hide/show groups business logic

    This uses 'findItem' and 'findContentItem' in appropriate contexts to hide/show groups (rectangle box highlights for clarity). In Silverlight you use 'FindControl' and 'FindControlInCollection'.

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Thursday, March 27, 2014 10:35 AM
  • Hi, it's the silverlight client.
    Friday, March 28, 2014 5:52 PM
  • In the restricted app go to entity designer and mark the fields as not to be displayed by default, in the client perspective. The default auto-generated dialog will then not show them.

    To hide/show:

    Data grid columns

    Using FindControl for single instance fields

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    Friday, March 28, 2014 6:22 PM