質問

I need the user to enter an ID instead of selecting the name. For example if you have 2 tables customers and orders, the user needs to enter the customer id in the order screen instead of selecting the name from the combo box.

How could I achieve this in LightSwitch?

役に立ちましたか?

解決

To do this you would create a parametrised query, with a single integer parameter.

  1. Add the new query to the screen (using Add Data Item), then drag it to the screen's control tree.
  2. Add a string property to the screen (again using Add Data Item) that you can then have the user type the id into, & drag it to the screen's control tree.
  3. Then just bind the query's parameter to the added string parameter, by clicking on the parameter (in the query on the left side of the screen designer), & setting the Parameter Binding value (in the Properties pane on the right side of the screen designer) to the name of the string property you added earlier. As you start typing, a list of choices will appear for you to choose from, or you can just type the whole thing yourself if you prefer.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top