一、下面的代码实现,每行显示三列
前台代码:
<%#DataBinder.Eval(Container.DataItem,"coisa")%>
后台代码:
protegido int i=1;
private void Page_Load (remetente do objeto, System.EventArgs e)
{
XmlSerializer ser = new XmlSerializer(typeof(DataSet));
DataSet ds = new DataSet("meuDataSet");
DataTable t = new DataTable("tabela1");
DataColumn c = new DataColumn("coisa");
t.Colunas.Add(c);
ds.Tables.Add(t);
Linha de dados r;
para(int i = 0; i<10;i++)
{
r = t.NewRow();
r[0] = eu;
t.Rows.Add(r);
}
this.Repeater1 .DataSource =ds.Tables [0].DefaultView ;
this.Repeater1.DataBind();
}
private void Repeater1_ItemDataBound (remetente do objeto, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
se(i%3==0&&i>0)
{
e.Item.Controls.Add(new LiteralControl("