请问如何取得我数据绑定出勤一列里面的值!我要对其进行汇总!DataList代码如下!
<asp:datalist id="rptShow" runat="server" Width="100%" CellPadding="0" Height="48px">
<HeaderTemplate>
<TABLE id="Table1" cellSpacing="1" cellPadding="2" width="100%" align="center" border="0">
<TR bgcolor="#99ccff">
<td>
<TABLE id="Table3" cellSpacing="1" cellPadding="1" width="100%" align="center" bgColor="#ffffff"
border="0">
<TR align="center" bgcolor="#99ccff">
<TD align="center" width="7%">姓名</TD>
<TD align="center" width="5%">出勤</TD>
<TD align="center" width="4%">病假</TD>
<TD align="center" width="4%">事假</TD>
</TR>
</TABLE>
</HeaderTemplate>
<ItemTemplate>
<TABLE id="Table2" cellSpacing="1" cellPadding="1" width="100%" align="center" bgColor="#ffffff" border="0">
<TR align="center" bgColor="#e9f1fb">
<TD align="center" width="7%"><%# DataBinder.Eval(Container.DataItem,"Emp_Name")%></TD>
<TD align="center" width="5%"><%# Format(DataBinder.EvaContainer.DataItem,"Check_Type0").ToString())%></TD>
<TD align="center" width="4%"><%# Format(DataBinder.Eval(Container.DataItem,"Check_Type1").ToString())%></TD>
<TD align="center" width="4%"><%# Format(DataBinder.Eval(Container.DataItem,"Check_Type2").ToString())%></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:datalist>

如何获得<TD align="center" width="5%"><%# Format(DataBinder.EvaContainer.DataItem,"Check_Type0").ToString())%></TD>
所有的值!怎样循环取出每一行的记录!请各位师兄的大力帮忙!小弟在这里不胜感激!

解决方案 »

  1.   

    在 datatable 中获取, 用 datatable.select()方法获取, 然后在 data_itemdatabind 中调用 ....private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    switch ((int)(e.Item.ItemType))
    {

    case (int)ListItemType.Footer:

    e.Item.Cells[0].Text = "合计";

    e.Item .Cells[0].Attributes.Add("align","center");
    e.Item.Cells[1].Text=Report.get_Sum(dt1,"Sum(nowrealtpower)","true"); //调用 
    e.Item .Cells[1].Attributes.Add("align","center");
    e.Item .Cells[3].Text=Report.get_Sum (dt1,"Sum(lastrealtpower)","true");


     

    }
    }
      

  2.   

    小弟不才!!我是在DataList之外有一个按钮!点击按钮然后取出DataList它里面的值!!
      

  3.   

    对!没错!我在DataList外面有一个按钮!用来统计!!请问有什么好方法!