cellPerson.BackColor = Color.Navy;
cellPerson.ForeColor = Color.Yellow;
cellPerson.ColumnSpan = 3;
cellPerson.HorizontalAlign = HorizontalAlign.Center;
cellPerson.Controls.Add(new LiteralControl("个人信息"));
TableCell cellJob = new TableCell();
cellJob.BackColor = Color.Navy;
cellJob.ForeColor = Color.Yellow;
cellJob.ColumnSpan = 2;
cellJob.HorizontalAlign = HorizontalAlign.Center;
cellJob.Controls.Add(new LiteralControl("工作信息"));
e.Item.Controls.Add(cellJob);
m_CreatePageTimes ++;
}else if(m_CreatePageTimes ==1){
// create custom pager UI
}
}
最后是DataGrid的HTML部分的代码如下:
<asp:DataGrid id="DataGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="False" Width="100%"
PageSize="2">
<Columns>
<asp:BoundColumn DataField="name" HeaderText="姓名"></asp:BoundColumn>
<asp:BoundColumn DataField="BirthDate" HeaderText="生日"></asp:BoundColumn>
<asp:BoundColumn DataField="Country" HeaderText="国家"></asp:BoundColumn>
<asp:BoundColumn DataField="Title" HeaderText="头衔"></asp:BoundColumn>
<asp:BoundColumn DataField="HireDate" HeaderText="雇佣日期"></asp:BoundColumn>
</Columns>
<PagerStyle Position="TopAndBottom" Mode="NumericPages"></PagerStyle>
</asp:DataGrid>
运行效果如下所示:
作者笔名 | 简短内容 | 发表时间 |
: | |