Visual
Studio LightSwitch is a Microsoft tool ,which is used for build the business
application. If you want add user and word in modal window in LightSwitch
application then you can do .
Step
by step solution for create Username and word in Modal window.
Step
1 :
Open visual studio LightSwitch->Create new table.
Step 2 : Create table like as subscriber.
Step 3 : Now we will add screen. Right click on screens->Add
screen.
Step 4 : Select editable grid screen->Select screen data
(Subscriber)->Ok.
Step 5 : Now add new group.
Step 6 : Expand group->Select modal window.
Step 7 : Move username and
word from screen to modal window.
Step 8 : Change group name and unmark isvisible.
Step 9 : Add data item->Local property->Type
(string)->Name (ReEnteredNewword)->Ok.
Step 10 : Now move ReEnyeredNewword from screen to modal
window.
Step 11 : Again add data item->Local property->Type
(Subscriber)->Name (NewSubscriber)->Ok.
Step 12 : Right click on add in commandbar->Select override
code.
Code
using System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using
Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using
Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{
public partial class EditableSubscribersGrid
{
partial
void gridAddAndEditNew_Execute()
{
// Write your code here.
this.OpenModalWindow("AddSubscriber");
}
}
}
Step 13 : Run application (Press F5).You will see a new window of
username and word.
Step 14 : If you want add and
edit username and word then you can do.
Code
using
System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using
Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using
Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{
public
partial class
EditableSubscribersGrid
{
partial
void gridAddAndEditNew_Execute()
{
// Write your code here
NewSubscriber = new
Subscriber();
ReEnteredNewword = String.Empty;
this.OpenModalWindow(ADD_SUBSCRIBER_WINDOW);
this.FindControl(ADD_SUBSCRIBER_WINDOW).ControlAvailable
+=
new
EventHandler<ControlAvailableEventArgs>(NewSubscriber_WindowAvailable);
}
}
}
Step 15 : Run application (Press F5). Now you can add and edit
username and word.