>

Articles → LIGHT SWITCH 2011 → Multiple search parameters in lightswitch 2011

Multiple search parameters in lightswitch 2011






























Software requirement











Prerequisite knowledge



















Creation of table


Picture showing the sample table and relationship between them

Click to Enlarge




Creation of editable screen


Picture showing creating the editable grid screen for both the tables

Click to Enlarge




Create query on table


Picture showing creating the query on the table

Click to Enlarge





declare @EmployeeName as varchar(max)
  set"@EmployeeName = 'karan'
  select * from Employee where EmployeeName = @EmployeeName




select 
  * 
from 
  Employee





Add query on editable screen






Picture showing adding the query on the editable grid screen

Click to Enlarge



Picture showing deleting the existing grid and drag the query on the screen

Click to Enlarge



Picture showing the design screen after deleting Employee Name and Id filter

Click to Enlarge


Add data items for filters




Picture showing adding the 2 data items in the project

Click to Enlarge



Picture showing the data items added in the design screen

Click to Enlarge


Add filters in popup




Picture showing adding both the data items as filter

Click to Enlarge




Add button to open modal window




Picture showing adding a new button with the caption filter

Click to Enlarge


Button’s execute events


/// <summary>
/// Method invoked when 
/// Filter button is clicked
/// </summary>
partial void Filter_Execute() {
	this.OpenModalWindow("Group");
}

/// <summary>
/// Method invoked when Apply Filter
/// button is clicked.
/// </summary>
partial void ApplyFilter_Execute() {
	this.CloseModalWindow("Group");
}





Bind query parameters with data item




Picture showing setting the parameter binding for query

Click to Enlarge



Picture showing the parameter binding on the design screen

Click to Enlarge



Picture showing the parameter binding for second data item

Click to Enlarge


Output




Picture showing the output of the Multiple search parameters in lightswitch

Click to Enlarge



Picture showing the output of the Multiple search parameters in lightswitch

Click to Enlarge



Picture showing the output of the Multiple search parameters in lightswitch

Click to Enlarge




Download



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, July 10, 2012

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250