|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
#region Event Handlers
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
gv.BindDataSource();
}
protected void gv_DataSourceRequested(out Array dataSource)
{
dataSource = GetTestData();
}
#endregion
#region Private
private ProductInfo[] GetTestData()
{
ProductInfo[] res = new ProductInfo[8];
res[0] = new ProductInfo("TV-Tuner", 1, 40.00);
res[1] = new ProductInfo("Modem", 2, 19.00);
res[2] = new ProductInfo("Motherbord", 1, 120.00);
res[3] = new ProductInfo("Keyboard", 18, 5.00);
res[4] = new ProductInfo("Mouse", 25, 4.99);
res[5] = new ProductInfo("Mouse pad", 30, 1.50);
res[6] = new ProductInfo("Monitor", 4, 234.00);
res[7] = new ProductInfo("Fan", 10, 8.00);
return res;
}
#endregion
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.