locked
Distinct drop down list RRS feed

  • Question

  • Hello

    I'm having troubles with creating a distinct list in LightSwitch.

    The idea is that I have a table with values {a, b, c}

    In another table I must choose a and b or only c.

    Now is the problem that I want a dropdown with only the available values.

    I don't know how I create a distinct query and how I pass the values that doesn't apply anymore.

    How and where do I start in LightSwitch?

    Kind regards

    Jonas Vandevelde

    Thursday, May 2, 2013 9:23 AM

Answers

  • I'm not exactly clear on what you mean.

    If you mean that you have a table with more than one value, then "I" would try to make an SQL view.  The problem with views is that you have to include columns that can be inferred as a key.  Many here, would recommend using a RIA Service.  You can see that here:

    Using WCF RIA Services With LightSwitch: I Know You’re Scared, I Understand

    Disclaimer... I haven't used ria yet... because of my setup (connecting to databases, not using the Intrinsic Database for Application data) I do everything in SQL Server where possible.

    If what you are needing is a drop down box that dynamically refreshes the information based on something else, you can see Beth's information here:

    Creating Cascading Drop Down Lists in Visual Studio LightSwitch

    Am I close?  If not, tell us more and I think we (as in those monitoring this community) will point you in the right direction.


    Would someone please turn on the LIGHT?


    Thursday, May 2, 2013 2:01 PM

All replies

  • I'm not exactly clear on what you mean.

    If you mean that you have a table with more than one value, then "I" would try to make an SQL view.  The problem with views is that you have to include columns that can be inferred as a key.  Many here, would recommend using a RIA Service.  You can see that here:

    Using WCF RIA Services With LightSwitch: I Know You’re Scared, I Understand

    Disclaimer... I haven't used ria yet... because of my setup (connecting to databases, not using the Intrinsic Database for Application data) I do everything in SQL Server where possible.

    If what you are needing is a drop down box that dynamically refreshes the information based on something else, you can see Beth's information here:

    Creating Cascading Drop Down Lists in Visual Studio LightSwitch

    Am I close?  If not, tell us more and I think we (as in those monitoring this community) will point you in the right direction.


    Would someone please turn on the LIGHT?


    Thursday, May 2, 2013 2:01 PM
  • Yeah the second link pointed me in the right direction as you said.

    Thank you very much !

    Tuesday, May 7, 2013 9:01 AM
  • Excellent, and I'm glad it helped!

    Would someone please turn on the LIGHT?

    Tuesday, May 7, 2013 10:34 AM