Articles → LIGHT SWITCH 2011 → Multiple Search Parameters In Lightswitch 2011

Multiple Search Parameters In Lightswitch 2011






Software Requirement




  1. Visual studio 2010 is installed on your machine.
  2. Visual Studio 2010 service pack 1 is installed on your machine.
  3. Microsoft Visual Studio Light switch 2011 is installed on your machine.

Prerequisite Knowledge




  1. How to create lightswitch tables?
  2. How to add screens in lightswitch application?
  3. How to add data item?
  4. How to create modal pop up?
  5. How to add query for table.
  6. How to bind grid with query?
  7. How to add relationship between tables?

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