Imports System
Imports System.Web.ModelBinding
Imports Northwind45.BusinessObject
 
Namespace Northwind45
    Partial Public Class GridViewGroupingProductsByCategories
        Inherits System.Web.UI.Page
 
        Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
            Functions.GridViewRowDataBound(sender, e, 1)
        End Sub
 
        Public Function GetRepeaterData() As CategoriesCollection
            Return Categories.SelectAll()
        End Function
 
        Public Function GetGridData(<Control> HfCategoryID As Integer?) As ProductsCollection
            If HfCategoryID.HasValue Then
                Return Products.SelectProductsCollectionByCategories(Convert.ToInt32(HfCategoryID.Value))
            Else
                Return Nothing
            End If
        End Function
    End Class
End Namespace