<TemplateColumn></TemplateColoumn>具体用法查MSDN帮助

解决方案 »

  1.   

    我就不喜欢使用数据库感知控件,尤其是DataGrid,太局限了,使用ListView等控件自己编码实现吧,想怎么控制就怎么控制。:-)
      

  2.   

    我想用table
    可是如何给页面里赋值呢?
    我的代码如下:
    *.cs文件里:
    string sql="select worker_id,worker_name from t_worker";
    DataAccess db = new DataAccess();
    DataSet ds = db.GetDataSet(sql,"table");

    int num= ds.Tables["table"].Rows.Count;
    int numcells=8;
    int numrows = num/numcells+1;
    for(int i=1;i<=numrows;i++)
    {
         TableRow r = new TableRow();
    for(int j=1;j<=numcells;j++)
    {
    int m = (i-1)*numcells+j;
    if(m<=num)
    {
    TableCell c = new TableCell();
    string worker_name = ds.Tables["table"].Rows[m]["worker_name"].ToString();
                   …………………………
                   …………………………
                    //c.Controls.Add(new LiteralControl(worker_name));
    r.Cells.Add(c);
              }
    Table_worker.Rows.Add(r);
    }
    }*.aspx文件里:
    <asp:Table id="Table_worker" runat="server">
    …………………………
    </asp:Table>
    我想在每个单元格里实现链接,
    该怎么写?