locked
Auto select dialog in modal window not always returning selection. RRS feed

  • Question

  • I have a modal window with 2 autoselect dropdowns.  Selecting an item in the first dropdown determines what can be selected in the second via query.  Works fine except user must actually select the item in the second dropdown with mouse click.  Lightswitch does not accept the default selection without re-selecting the 2nd drop down item   How can I make certain that the item displaying in the 2nd drop down will be selected without requiring a mouse click. 
    Tuesday, January 1, 2013 6:36 PM

Answers

  • You can implement INotifyPropertyChanged for the property that the screen is bound to (if your ACB's are bound to entity properties), as discussed in:

    How to do Screen only Validation in Property/Field Level (the thread is about validation, but the technique is the same for what you want to do)

    If they're not bound to entity properties, you can set the second ACB's value in the Changed method of the screen property that the first ACB is bound to.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Proposed as answer by Angie Xu Thursday, January 10, 2013 1:27 AM
    • Marked as answer by Angie Xu Monday, January 14, 2013 12:27 AM
    Wednesday, January 2, 2013 1:08 PM
    Moderator

All replies

  • Do you mean that you have several AutoComplete Box controls in your edit/add window and one say product displays all of the products and the second shows the corresponding details? If the first drop down explicitly defines the second do you need an AutoComplete control on the second parameter of the table/screen or is it just ussually explicitally defined by default but there are exceptions so you need an option to select any corresponding variable of the second parameter?
    Wednesday, January 2, 2013 10:46 AM
  • Hi, can you show us the code that you are using and confirm your environment, ie. VS2012/LS2011? Perhaps a screen designer screenshot would help to show bindings and queries.

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


    • Edited by Xpert360 Wednesday, January 2, 2013 11:39 AM
    Wednesday, January 2, 2013 11:37 AM
  • You can implement INotifyPropertyChanged for the property that the screen is bound to (if your ACB's are bound to entity properties), as discussed in:

    How to do Screen only Validation in Property/Field Level (the thread is about validation, but the technique is the same for what you want to do)

    If they're not bound to entity properties, you can set the second ACB's value in the Changed method of the screen property that the first ACB is bound to.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Proposed as answer by Angie Xu Thursday, January 10, 2013 1:27 AM
    • Marked as answer by Angie Xu Monday, January 14, 2013 12:27 AM
    Wednesday, January 2, 2013 1:08 PM
    Moderator