You are here:   Forum
Register   |  Login

Forum Notice

For new Visual Studio LightSwitch questions,
It is recommended that you use the official Visual Studio LightSwitch Forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Forums

Getting data from a query and using it on screen
Last Post 18 Jun 2012 05:54 AM by Rhino2075@gmailc.com. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
RhinoSmithUser is Offline
New Member
New Member
Send Private Message
Posts:2
Avatar

--
17 Jun 2012 02:31 PM
        I have a screen with several autocomplete boxes populated by queries and set up as 1 to many relationships. The queries and autocomplete boxes work as intended. I cannot, however, figure out how to access the other data in the query when the user selects it. 
        For instance, if a user selects a customer and that customer has several ship to addresses which are popluated in an autocomplete box based on the selected customer. The query works fine..the auto box shows the customers ship to names. But I need to popluate the screen with the acutal address data, i.e., address, city, state when the user changes the ship to.
        Everything I've done through code only points to the first record in the query and not the one selected. It would seem that dragging the field onto the screen from the query would work, but it does not. I've used code in the property change event equivalent to Me.ScreenCityProperty=Me.query.City. This always points to the first record in the query and never for the selecteditem. This seems so simple to do.

    Thanks in advance,

    Rhino
    hgminervaUser is Offline
    Veteran Member
    Veteran Member
    Send Private Message
    Posts:98
    Avatar

    --
    17 Jun 2012 04:43 PM
    You can do this using Linq. Below is the pseudo code to get the idea:

    Dim Addreses = (from s in where s.id=).firstordefault
    if not isnothing(adresses) then
    address = addresses.address
    city = addresses.city
    end if
    http://hgminerva.wordpress.com
    RhinoSmithUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:2
    Avatar

    --
    18 Jun 2012 05:54 AM
    Thanks for your response hgminerva. I still think in terms of pulling data from a table that all the row data would be pulled in the query and accessable on from the screen. Guess that is not the case.
    You are not authorized to post a reply.


    Latest Microsoft Visual Studio LightSwitch Forum Threads That Have Answers

    This is really strange ! After upgrading the lightswitch engine with Update 1, I'm suddenly unable to navigate forward to another screen (using myapp.showSomeScreen() ) from my home screen. Then, when I try to navigate back (using native previous arrow), I get the following error: TypeError: Unable to get property 'unit' of undefined or null reference    at wu (http://localhost:19952/HTMLClient/Scripts/msls-1.0.1.min.js:5:230291)    at au (http://localhost:19952/HTMLClient/Scripts/msls-1.0.1.min.js:5:121782)    at Anonymous function (http://localhost:19952/HTMLClient/Scripts/msls-1.0.1.min.js:5:121648)    at each (http://localhost:19952/HTMLClient/Scripts/jquery-1.9.1.min.js:3:5250)   
    Read more...

    I am following the Working with Data in LightSwitch (Guided Tour) at http://msdn.microsoft.com/en-us/library/ff851982.aspx, and at the "Connecting to Data" portion I am unable to choose "OData Service" in the Attach Data Source wizard. It just doesn't appear. See attached. What do need I to do to get "OData Service" to appear, so I can choose it? Thank you! - tom
    Read more...

    The Lightswitch security available at this time is at the entity level. There is also Row Level Security, but, as far as I know, there is no Lightswitch security implemented at the property level According to this article: http://blogs.msdn.com/b/lightswitch/archive/2012/04/17/filtering-data-using-entity-set-filters-michael-simons.aspx I took out the confidential properties of an entity A and put it into another entity B.  Then I define a 1 to 0..1 relationship between entity A and entity B.   I also wrote the necessary code in the A_Created general method in order to create the related B entity. Now suppose that we have different permissions defined for the two entities for all CRUD operations. (Security concerns were the reason why I split the original entity) According to this article: Read more...

    I would like to open HTML client screen from Silverlight client.
    Read more...

    In the Silverlight client we had the Auto Complete Box that you could bind to either a Query or a Choice List based property. In the current HTML client we have the Drop Down control that you can bind to a Choice List based property only from what I can see. Questions: 1/ Can we bind a Drop Down control to a Query? 2/ Can we dynamically populate a Choice List in Javascript at run-time (this was not possible in the Silverlight client)? If neither of the above are possible, what is the recommended way to have Drop Downs that are based on a query or dynamic data? Thanks in advance Regards, Xander
    Read more...

    1234

    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation