locked
Linked Data Sets on Screen RRS feed

  • Question

  • Hi, 

    Hopefully this is a simple question, but I'm stumped. I'm using VS2012.

    I have a master detail screen, and I want to add a new detail table to it. The table has a relationship defined (I have tried using implicit Fk relationships and explicit LS relationships).

    When I add the table using Add Data Item, it gets created, but no link is established. But if I create a new screen from scratch the link is there. As far as I can see, the difference is that there is arrow between the two tables when I create a screen from scratch, but I am unable to make that happen if the screen is already there when I add the table. 

    So what am I missing?

    Thanks, 

    Mark


    

    Friday, May 24, 2013 7:09 AM

All replies

  • If you look at the collection (say Customers) in the left panel of the designer, you will see that it contains a node called Selected Item, below which are the properties for the item. If you drag the Selected Item onto the designer, it will add the required controls to display the details. This automatically creates the link between the list and the individual item.

    Hope this helps. If you need any more help, please post back and explain where you're having problems.

    P.S. Just to add on, there is nothing special about any of the screen templates. They just set some stuff up for you to save a bit of time. You could use any template and modify it to create any kind of screen layout.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/


    • Edited by Mr Yossu Friday, May 24, 2013 1:35 PM Added P.S.
    • Proposed as answer by Garth F Henderson Tuesday, May 28, 2013 1:21 PM
    Friday, May 24, 2013 1:34 PM
  • Thanks for the reply.

    Unfortunately this didn't resolve my issue. Let explain in a little more detail. I'm sure I'm just missing something obvious. 

    I have Master Detail screen. There are a list Contracts down the left, and tabbed details on the right (a tab for each set of details). One of the attributes (Region) has a many to many relationship to Contract. I've created the tables that resolve the many to many, created the relationships (one to many) and looks fine. I'm intending to use the Many to Many control to display the regions as a list of checkboxes (there are only 3 so that should be fine) 

    I add the ContractRegion table to the screen designer. It appears, I drag the set onto the screen and it defaults to a grid. Thats fine for now. But when I run, it just displays every single contract region, without filtering it down to just the one that corresponds to the selected contract. 

    So somehow, the link between contract and contractregion has not been established. And I can't see why. 

    If I do the same thing with a new screen, establishing the link during creation, everything is fine (including the many-to-many control). So I'm clearly missing some step when I'm adding the table to the screen.

    I just can't figure out what that is...

    Mark

    Friday, May 24, 2013 3:24 PM
  • Hmm, without seeing it, it's hard to know exactly why it's not working, however if you just added the ContractRegion table to the screen designer, then dragging it onto the design surface would cause it to show all entries. This is logical, as it doesn't have any way of knowing to filter the list.

    When you do the same with a new screen, how exactly do you establish to link? Bear in mind that there's nothing that happens when you create a screen that you can't do manually to an existing screen. The templates just save you a bit of work, they don't do anything magical, so if you can do it when you create a new screen, you can do it to an existing one. I just need to know exactly what you do when you create a new one.

    If you want to pull together a small sample that shows the problem (ie new screen that works and existing one that doesn't) and email it to me at mryossu at hotmail dot com then I'll try and have a look.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Sunday, May 26, 2013 2:03 PM