日期:2014-05-18  浏览次数:20399 次

.NET2005,表格、数据,问题!急急急!30分
.NET2005,怎么用代码创建表格,而且把数据写到创建的表格里。

------解决方案--------------------
05里面不是有Table这个控件吗
这样写就行了
Radi rad = new Radi();
rad.RepeatDirection = RepeatDirection.Horizontal;
TextBox box = new TextBox();
box.TextMode = TextBoxMode.Password;
rad.Items.Add("男"); rad.Items.Add("女");
cob com = new cob();
com.Items.Add("本科");com.Items.Add("大专");com.Items.Add("硕士");
this.Table1.Rows[0].Cells[1].Controls.Add(new TextBox());
this.Table1.Rows[0].Cells[3].Controls.Add(box);
this.Table1.Rows[1].Cells[1].Controls.Add(new TextBox());
this.Table1.Rows[1].Cells[3].Controls.Add(rad);
this.Table1.Rows[2].Cells[1].Controls.Add(com);
this.Table1.Rows[2].Cells[3].Controls.Add(new TextBox());
------解决方案--------------------
CSS code

<style type="text/css">
        .tabStyle { color: #333; background-color:Maroon;}
        .tabStyle td { margin: 1px; padding: 2px; background-color:White; }
        
</style>