none
Has Anyone Archived the List Box Mover Tutorial RRS feed

  • Question

  • I once or twice setup the controls and code laid out by Andy Kung's listbox mover UI. You can read more about it here. http://blogs.msdn.com/b/lightswitch/archive/2010/12/16/how-to-create-a-many-to-many-relationship-andy-kung.aspx

    That said the blog is no longer up and running so I view reference these steps. I know you have to set up a light switch project with a linking table and two entity tables for each side. I know that a data grid screen can be used to populate each table on the sides of the many to many relationship. I also know you need to setup a details screen (not sure if I select the linking table or if I select the parent table and use a check box to include the linking table) I also still have the needed C# code to make the functional buttons to select associated child table entries in the many to many. If anyone has saved the instruction in any format text or document I would appreciate this I have a few books; Visual Studio LightSwitch 2015 by Tim Leung, and Creating HTML 5 Websites and Cloud Business Apps Using LightSwitch in Visual Studio 2013-2015 by Michael Washington. The Tim Leung book addressed using the many to many control to create a screen with check boxes to create the necessary many to many connections but I have had trouble migrating any desktop Projects in Visual Studio 2012 C# that the extension for Many to Many Control associated with the project. That and I just like the List Box Mover for intuitive user interface.

    This is the Andy Kung list box code in C#

    partial void Button_Execute()
    {
      if (GenreCollection.SelectedItem != null)
      {
        bool genreExists = false;
        foreach (MovieGenre mgSearch in this.MovieGenreCollection)
        {
          if (mgSearch.Genre.Name == this.GenreCollection.SelectedItem.Name)
          {
            genreExists = true;
          }
        }
    
        if (genreExists == true)
        {
          ScreenExtensions.ShowMessageBox(this, "Genre already exists");
        }
        else
        {
          MovieGenre mg = MovieGenreCollection.AddNew();
          mg.Movie = this.Movie;
          mg.Genre = GenreCollection.SelectedItem;
        }
      }
    }

     


    Tuesday, December 18, 2018 5:32 PM

Answers