I have a label where user will input a value for filter. i like to
take that value and implement it with the code i posted so that the
childgrid now have filtered data. hope it makes sense. (see example
here: http://www.codeproject.com/KB/aspnet/EditNestedGridView.aspx )
please suggest. I heard or read that filters are implemented after
databind; not sure...


private DataTable ChildDataSource(string strlpID, string strSort)
{
SqlConnection conn;
SqlDataAdapter daProducts;
DataTable dsProducts;
string strQRY = "";
conn = new SqlConnection(@"Server=riverstone; Integrated
Security=SSPI; Database=nw");
strQRY = "SELECT [Orders].[CustomerID],[Orders].[OrderID]," +
 "[Orders].[ShipAddress],[Orders].[Freight],[Orders].[ShipName] FROM
[Orders]" +
 " WHERE [Orders].[CustomerID] = '" + strlpID + "'" +
 "UNION ALL " +
 "SELECT '" + strlpID + "','','','','' FROM [Orders] WHERE [Orders].
[CustomerID] = '" + strlpID + "'" +
 "HAVING COUNT(*)=0 " + strSort;
daProducts = new SqlDataAdapter(strQRY, conn);
dsProducts = new DataTable();
daProducts.Fill(dsProducts);
return dsProducts;
}

Reply via email to