////////////////分页处理程序;
void Page_Load(Object sender, EventArgs e)
{
if (CheckBox1.Checked)
ItemsGrid.PagerStyle.Mode=PagerMode.NumericPages;
else
ItemsGrid.PagerStyle.Mode=PagerMode.NextPrev;
if (!IsPostBack)
{
start_index = 0;
ItemsGrid.VirtualItemCount=100;
}
BindGrid();
}
/////////////邦定公用函数;
void BindGrid()
{
ItemsGrid.DataSource=CreateDataSource();
ItemsGrid.DataBind();
}
///////////////////////// 数据库的链 接在前面已经发表过的,!
BorderWidth="1"
CellPadding="3" //行间隔;
AllowPaging="true" //换页开关;
AllowCustomPaging="true" //
BackImageUrl="Images\image1.jpg" //背景图象;
AutoGenerateColumns="false" //改变属性数据格会不一样有:true & false;
OnPageIndexChanged="Grid_Change"> //分页驱动程序ID
//分页默认样式;
Position="Bottom"
PageButtonCount="5"
BackColor="#00aaaa">
DataField="StringValue"/>
DataField="CurrencyValue"
DataFormatString="{0:c}">