FilterExpression is used to filter the data retrieved when the Select method is
called. The method specified in the SelectMethod property must return a DataSet,
DataView or DataTable.
SortingExpression is used to sort the data retrieved by ISDataSourceControl. The
SortExpression in ISDataSource will always act as secondary sorting after the data-bound
controls sorting mechanism.
This sample demonstrates how to use FilterExpression and SortExpression.
To use ISDataSource along with FilterExpression
- Binding DataSet
to ISDataSource. (Use Products table).
- Add a TextBox and a Server-side button.
- Write the following function in OnButtonClick Client-side event :
protected void Button1_Click(object sender, EventArgs e)
{
ISDataSourceTable table = ISDataSource1.Tables.GetNamedItem("Products");
table.FilterExpression = TextBox1.Text;
}
|
- The result will be like following.

To use ISDataSource along with SortExpression
- Binding DataSet
to ISDataSource. (Use Customers table).
- Add a TextBox and a server-side button.
- Write the following function in OnButtonClick client-side event:
protected void Button1_Click(object sender, EventArgs e)
{
ISDataSourceTable table = ISDataSource1.Tables.GetNamedItem("Customers");
table.SortExpression = TextBox1.Text;
GridView1.DataBind();
}
|
- The result will be like following.