可以在DataGrid的ItemDataBound事件中赋值
如:
e.Item.Cells[3].Text = (string)DataBinder.Eval(e.Item.DataItem,"title");
表示在当前DataGrid的第四列显示当前记录集中当前记录的title字段值
不知道楼主是否要这总效果.

解决方案 »

  1.   

    <asp:DataGrid id="DataGrid" runat="server" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" GridLines="Vertical" AutoGenerateColumns="False">
    <SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
    <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#000084"></HeaderStyle>
    <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    <Columns>
    <asp:BoundColumn DataField="FunName" HeaderText="条件名称"></asp:BoundColumn>
    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
    </asp:DataGrid>
      

  2.   

    <asp:DataGrid id="DataGrid" runat="server" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" GridLines="Vertical" AutoGenerateColumns="False">
    <SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
    <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#000084"></HeaderStyle>
    <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    <Columns>
    <asp:BoundColumn DataField="FunName" HeaderText="条件名称"></asp:BoundColumn>*注意这里*
    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
    </asp:DataGrid>
      

  3.   

    晕,大家也谈谈思路吧,不要一个劲的贴代码,虽说代码最能体现思想……但对我这种初学.NET的人来说很难受。:)
      

  4.   

    我把我的思想和你说一下吧:(代码看得我很晕:))从数据库中取得DATE放到DATESET中去后,你遍历这个DATESET
    其中你可以取你要的数据,like this:
    for(i=0;i<dateset1.rows.count;i++)
    Response.write("<td>dateset1.rows.item</td>");代码并不完整哦~~  ;)
      

  5.   

    aspx文件中添加一个div控件
    <div id="tableinfo" runat="server">cs中
    //用SqlDataReader读出数据库的数据
    StringBuilder table=new StringBuilder();//在table定义表格的格式
    table.Append("<table>");
    while(myReader.Read())
    {
      table.Append("<tr><td>标题:</td><td>");
      table.Append(myReader.GetString(0));
      table.Append("</td><tr>");
      ....
    }
    myReader.Close();
    mycon.Close();
    table.Append("</table>");
    tableinfo.InnerHtml=table.ToString();
      

  6.   

    使用动态的Table组件一样得到上面的效果。
      

  7.   

    ameng_2002(星星之火) 的方法是最好的。既得到与ASP中一样的灵活性。效率也大为提高。
      

  8.   

    到微软的网站去下个Windows Media Encoder 7.1 CN.exe。客户端用mediaplay接收。