locked
Auto Complete Box in List and Detail screen not available! RRS feed

  • Question

  • Hi Guys,

    Still very much a novice at all this. I have a tables relationship 'Project' and 'PAF' - A PAF(one) must have a Project(many) A project can have many PAF Instances.

    When I create a new List and Details screen I do not have the option for auto complete box to be used! I want to have a drop down list so that the user can select the project and it will display a list of PAF's for that project???


    kevin delaney
    Wednesday, August 31, 2011 2:58 AM

Answers

  • If you add a new local property to the screen that is a Project entity, then you can drag out the member to the content tree and change it to an Auto Complete Box. Then write some code for the Changed event of that local property that sets the SelectedItem of the Projects collection to be the value of the local property:

    partial void Project_Changed()
    {
      this.Projects.SelectedItem = this.Project;
    }
    


    You can write similar code for the collection's SelectionChanged event to keep the selected item and the local property in sync:

    partial void Projects_SelectionChanged()
    {
      this.Project = this.Projects.SelectedItem;
    }
    
    So now when you select an item from the Auto Complete Box, the selection of the collection will be kept in sync, and the related PAFs will be shown in the data grid.


    Justin Anderson, LightSwitch Development Team
    Wednesday, August 31, 2011 4:01 AM
    Moderator

All replies

  • I want the system to have a drop down list next to Project No not 'Project 
    kevin delaney
    Wednesday, August 31, 2011 3:01 AM
  • You select the Project of interest on the Left.  It then has Project details on the right - including the PAFs.  What are PAFs anyway?

    So picking the projects from a dropdown does not make sense in this case as your projects are what you are selecting on the Left.  Does this make any sense?  Maybe not understanding your issue yet.

    • Proposed as answer by PowerBala Wednesday, August 31, 2011 3:38 AM
    Wednesday, August 31, 2011 3:28 AM
  • William is right. If you want to pick up a "Project No" from a drop down, you can't use "LIST" control.  List control doesn't support "Drop Down".  You need a Data Grid in order to do that.


    -Bala
    Wednesday, August 31, 2011 3:42 AM
  • This Is the screen I want only I dont want to create a new project just view the lists of PAF below!

     


    kevin delaney
    Wednesday, August 31, 2011 3:55 AM
  • If you add a new local property to the screen that is a Project entity, then you can drag out the member to the content tree and change it to an Auto Complete Box. Then write some code for the Changed event of that local property that sets the SelectedItem of the Projects collection to be the value of the local property:

    partial void Project_Changed()
    {
      this.Projects.SelectedItem = this.Project;
    }
    


    You can write similar code for the collection's SelectionChanged event to keep the selected item and the local property in sync:

    partial void Projects_SelectionChanged()
    {
      this.Project = this.Projects.SelectedItem;
    }
    
    So now when you select an item from the Auto Complete Box, the selection of the collection will be kept in sync, and the related PAFs will be shown in the data grid.


    Justin Anderson, LightSwitch Development Team
    Wednesday, August 31, 2011 4:01 AM
    Moderator
  • Thanks Justin. I removed the screen code from the Add New Screen window I showed you and its no longer adding projects :)
    kevin delaney
    Wednesday, August 31, 2011 4:21 AM