locked
Auto Complete A School By Default RRS feed

  • Question

  • I have an auto complete box on a screen and would like to populate that screen with a "No Preference" default. The default exists in the database I just can't quite get how to pull it and set it. On the entity_created() I think I am supposed to do something like:

    this.School.Name = DataWorkspace.ExternalData.Schools.Where(n => n.Name.Contains("No Preference").IsDefault... etc.

    I know this fails with a "Cannot implicitly convert type" error. But I think it shows the gist of what I am trying to do.

    Thursday, February 21, 2013 4:26 PM

Answers

All replies

  • I have an auto complete box on a screen and would like to populate that screen with a "No Preference" default. The default exists in the database I just can't quite get how to pull it and set it. On the entity_created() I think I am supposed to do something like:

    this.School.Name = DataWorkspace.ExternalData.Schools.Where(n => n.Name.Contains("No Preference").IsDefault... etc.

    I know this fails with a "Cannot implicitly convert type" error. But I think it shows the gist of what I am trying to do.


    Of course I am certainly open to and would appreciate any better ways to accomplish the goal.
    Thursday, February 21, 2013 6:07 PM
  • Ok I got it working. I used the solution found in this post: http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/e417b517-69ec-41b4-a7cd-a367610a0b0c/

    I hope this may help someone.

    • Marked as answer by Darnell Thursday, February 21, 2013 6:56 PM
    Thursday, February 21, 2013 6:56 PM