locked
Read-only items in Editable grid RRS feed

  • Question

  • How to make some items read-only in Editable grid?
    Sunday, May 13, 2012 10:28 AM

Answers

All replies

  • Hi

    Kindly provide more information.


    Rashmi Ranjan Panigrahi

    Sunday, May 13, 2012 10:34 AM
  • Hello Rashmi,

    An entity has 10 items, but the user should be allowed to edit only six of them.  Thus I need to lock the other four.

    Thanks,

    Dan

    Sunday, May 13, 2012 11:13 AM
  • In screen design choose 'Label' as the control for the columns that you want to be readonly.

    Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.

    Sunday, May 13, 2012 11:42 AM
  • Thanks for your reply.

    I did that but the result is very strange.

    When I click Edit I get the dialog box where one can see all items, although those that I want read-only are "Not visible" and are indeed not visible in the grid. Only part of them are grayed and indeed read-only while the others, although declared Label, can be edited.  

    Sunday, May 13, 2012 12:53 PM
  • Hi Dan

    The edit dialog box generated by lightswitch by default, which you can't control. So to cross this hurdles you have two option:

    1. Remove AddAndEditNew button and instead of that place only AddNew button. This will allow you to add a new row only. Your Popup dialog box will be removed.

    2. If you want an add & edit modal window, then you have to create your own. Please follow below thread for step by step walk-through demonstrated by sheel shah and Yann Duran

    http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/138464dd-f38e-48b6-a610-28279418b238/

    http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx

    Hope this help you...

    Regards


    Rashmi Ranjan Panigrahi

    Sunday, May 13, 2012 1:05 PM