Imports System Imports System.Web.ModelBinding Imports Northwind45.BusinessObject Imports System.Runtime.InteropServices Namespace Northwind45 Partial Public Class GridViewFilterBy_ProductsByCategoryID Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then DdlCategories.DataSource = Categories.SelectCategoriesDropDownListData() DdlCategories.DataBind() End If End Sub Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Functions.GridViewRowDataBound(sender, e, 1) End Sub Protected Sub GridView1_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Functions.GridViewRowCreated(sender, e, 0) End Sub Public Function GetGridData(<Control> DdlCategories As Integer?, maximumRows As Integer, startRowIndex As Integer, <Out()> ByRef totalRowCount As integer, sortByExpression As String) As ProductsCollection Return Products.SelectSkipAndTakeByCategoryID(maximumRows, startRowIndex, totalRowCount, sortByExpression, DdlCategories.Value) End Function End Class End Namespace