i guys,没有在asp中继器服务器控制上存在databound事件?

我只是想绑定我的所有数据,最后创建一个新的项目特图架并添加它,但只有何时绑定到

有帮助吗?

解决方案

我用它来计算集合中的总时间。即使我把它放入了世代odicetagcode,你也应该能够得到它。

FooterTemplate

protected void rptRecords_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    if (e.Item.ItemType == ListItemType.Footer)
    {
        int totalHours = 0;

        foreach (RepeaterItem item in ((Repeater)sender).Items)
        {
            Label lblRowHours = (Label)item.FindControl("lblHours");
            if (lblRowHours != null)
                totalHours += Convert.ToInt32(lblRowHours.Text);
        }

        ((Label)e.Item.FindControl("lblHoursTotal")).Text = totalHours.ToString();
    }
}
.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top