Articles → LIGHT SWITCH 2011 → Enable Multi Selection In Grid In Lightswitch 2011
Enable Multi Selection In Grid In Lightswitch 2011
Software Requirement
 
- Visual studio 2010 is installed on your machine.
 - Visual Studio 2010 service pack 1 is installed on your machine.
 - Microsoft Visual Studio Light switch 2011 is installed on your machine.
 
Prerequisite Knowledge
 
- How to create lightswitch project?
 - How to create an entity in lightswitch?
 - How to create a screen in lightswitch?
 - What is ControlAvailable event in lightswitch?
 
Steps Of Execution
 
- Creation of new project.
 - Creation of new table.
 - Creation of new screen.
 - Add data to table.
 - Add ControlAvailable event in screen’s created event.
 - Set the grid’s SelectionMode property.
 
Click to Enlarge
Click to Enlarge
Click to Enlarge
Click to Enlarge
partial void EditableEmployeesGrid_Created(){
  // Write your code here.
  this.FindControl("grid").ControlAvailable += new EventHandler<ControlAvailableEventArgs>(EditableEmployeesGrid_ControlAvailable);   
}
Partial void EditableEmployeesGrid_Created(){
            // Write your code here.
            this.FindControl("grid").ControlAvailable += new EventHandler<ControlAvailableEventArgs>(EditableEmployeesGrid_ControlAvailable);   
}
void EditableEmployeesGrid_ControlAvailable(object sender, ControlAvailableEventArgs e){
   if (e.Control is DataGrid)   {
         DataGrid grid = (DataGrid)e.Control;
         grid.SelectionMode = DataGridSelectionMode.Extended;
   }
}
Output
 
Click to Enlarge
| Posted By  -   | Karan Gupta | 
|   | 
| Posted On  -   | Wednesday, November 21, 2012 |