using
System;
using
System.Collections.Generic;
using
System.Web.UI.WebControls;
namespace
ResponsiveGridViewExample
{
public
partial
class
ResponsiveGridView : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindGridView();
}
}
private
void
BindGridView()
{
List<Product> productList =
new
List<Product>()
{
new
Product { ID = 1, Name =
"Product 1"
, Price = 100 },
new
Product { ID = 2, Name =
"Product 2"
, Price = 150 },
new
Product { ID = 3, Name =
"Product 3"
, Price = 200 },
new
Product { ID = 4, Name =
"Product 4"
, Price = 120 },
new
Product { ID = 5, Name =
"Product 5"
, Price = 180 }
};
GridViewData.DataSource = productList;
GridViewData.DataBind();
}
public
class
Product
{
public
int
ID {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
decimal
Price {
get
;
set
; }
}
}
}