Normally a Delete button is used to remove
unwanted information. Whenever we have unwanted data then we use a delete button.
In this article you learn how to disable and enable a delete button in
Step 1: Open Visual Studio
LightSwitch->File->New->Project->Create new table.
Step 2: Now we will make a table like student.
Step 3: Go to Properties in solution
Step 4: Select Use form
authentication->Mark Granted for debug.
Step 5: Right click on screen->Add
Step 6: Select Editable grid
screen->Select screen data (student)->Ok.
Step 7: Run Application (Press
F5)->Click + sign->Fill data->Ok->Save.
Step 8: Now you can delete any student
data using the delete button.
Step 9: If you want to disable the
delete button then click write code->Student_CanDelete->Now write the below code.
public partial class
Students_CanDelete(ref bool result)
result = this.Application.User.HasPermission(
Step 10: Go to properties in
Solution explorer->Use form authentication->Unmark Granted for debug.
Step 11: Run application (Press F5)->Now
you can't delete student data because delete button is disabled.
A Delete button is very useful for remove
unwanted data. Whenever we have we have wrong data the we use a delete button.
This article is very useful for enable and disable a delete button in LightSwitch