using System; using System.Web.ModelBinding; using Northwind45.BusinessObject; namespace Northwind45 { public partial class GridViewGroupingProductsByCategories : System.Web.UI.Page { protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { Functions.GridViewRowDataBound(sender, e, 1); } public CategoriesCollection GetRepeaterData() { return Categories.SelectAll(); } public ProductsCollection GetGridData([Control]int? HfCategoryID) { if (HfCategoryID.HasValue) return Products.SelectProductsCollectionByCategoryID((int)HfCategoryID.Value); else return null; } } }