Predefined Add Dialog not working as expected in Lightswitch 2012

265 Views Asked by At

I've created a query to use in an AutoCompleteBox and it works as expected when the user select the AutoCompleteBox in the grid as shown in the picture below

enter image description here

However if the user click the plus button to add a new record using the predefined Add Dialog then the query and the AutoCompleteBox's format doesn't work as shown in the picture below

enter image description here

Why is this happening and how I can fix that?

Thanks

1

There are 1 best solutions below

0
On

I haven't yet found a way to edit the default Add New dialog.

Instead, make a new screen, select the "New Data Screen" template, and link it to your entity data. You can customize the screen to fit your needs, even make it a Modal Window by changing the Control Type in the screen properties. Once you have the screen set up the way you want, go back to your grid screen, and double click on the Add... command in the Command Bar of your grid, to edit the AddAndEditNew_Execute code. In that method, call your custom screen.


So, as I got to thinking about this some more, I came back to the thought I had when I tried to do this a few months ago. There has to be a better way, so I Googled it again. This time, I found something. He's using an old version of Lightswitch, but I've successfully applied his technique in my application built in Lightswitch 2012.

http://www.c-sharpcorner.com/UploadFile/051e29/modal-window-in-editable-grid-screen-in-lightswitch-2011/