FilterParameters is a collection of parameters that you can use to fill a placeholder
in FilterExpression. (e.g : Country Like '{0}%' AND City Like '{1}%'). The placeholders
are replaced according to the index of the parameter in the FilterParameters collection.
This sample demonstrates how to use FilterParameters (multiple parameters [Country
& City])
To use ISDataSource along with Multiple FilterParameters
- Binding DataSet
to ISDataSource. (Use Customers table).
- Open ISDataSource designer and add Country Like '{0}%' AND City Like '{1}%' to FilterExpression
property.
- Add 2 TextBoxes and a server-side button.
- Right-click on ISDataSource control and go to the Designer >> Table Customers >>
Filter Parameters collection.
- Add 2 parameters to be linked to the textboxes.
- Write the following function in OnButtonClick client-side event :
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.DataBind();
}
|
- The result will be like following.