Solved

Lightswitch

Posted on 2014-02-19
4
281 Views
Last Modified: 2014-02-24
Hi Experts,

I'm developing a LightSwitch application.
I have and add/edit screen where I would like to disable a drop down list(combo box) if it is in edit mode.

I know how to disable a control. But just don't know how to do it only in edit mode .

 screen.findContentItem("mycombo").isEnabled = false;
0
Comment
Question by:MrStevenWin
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 210 total points
ID: 39871122
Hi, to know if your screen is used to edit/add a new entity. You can check the EntityState on the Property used in the screen.

The code would look something like:

screen.findContentItem("mycombo").isEnabled =  NameOfYourEntityProperty.Details.EntityState != EntityState.Added;

Open in new window

Where "NameOfYourEntity" would be the name of the entity you used to generate the screen.
0
 

Author Closing Comment

by:MrStevenWin
ID: 39873413
Below solved the issue. Thanks for your help!

myapp.AddEditLoanMaster.created = function (screen) {
    // Write code here.

   
    if (screen.myscreen.details.entityState != msls.EntityState.added) {
        screen.details.displayName = "Details Edit ";
        screen.findContentItem("mycontrol").isEnabled = false;
    }
 
};
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 39876249
You're welcome.
0
 

Author Comment

by:MrStevenWin
ID: 39882940
Hi Jerrith,

Could you pls. help me with my lightswitch question below?

www. experts-exchange .com/ Web_Development/WebApplications/Q_28372843.html

Thanks.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question