質問

In LightSwitch, when I open the default modal, calling the AddAndEditNew_Execute method, I want to change properties of the controls inside the modal dialog.

For instance: I want to change a TextBox to "Multiline" or change AutoComplete FilterMode to "Contains".

How can I access to those controls in execution time?

I know I can add a custom modal, but I just want to change a small thing of it and I don't want to create a whole modal dialog just for this.

I'm always talking about Silverlight client.

Thanks in advance.

役に立ちましたか?

解決

I'm afraid that the only way you can do what you want is:

  • with a custom modal window (if you want the window to be modal)
  • or a separate screen (if you don't need the window to be modal)

The properties of a default modal window can't be changed. There are no mechanisms to change the properties of any of the controls.

The only thing that you can do is to influence which properties get displayed in the default modal window, by checking/unchecking the Display By Default check-box in the table designer.

But as soon as you need to make changes to either the layout of the controls, or changing any control's properties, you need to create a custom modal window, or separate screen, & display then by calling them in custom code.

The reason for this is because the controls for the default modal window are generated by the LightSwitch run-time.

It's really just a matter of a balance between not having to do the work to create the window, & flexibility.

Default: Easy = Yes, Flexible = No
Custom: Easy = No, Flexible = Yes

I know it's not what you wanted to hear, but hopefully my explanation helps you to understand why you can't do it the way you first wanted to.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top