.net asp中继器数据绑定
伙计们,asp repeater服务器控件上不存在数据绑定事件吗.net asp中继器数据绑定,.net,asp.net,repeater,databound,.net,Asp.net,Repeater,Databound,伙计们,asp repeater服务器控件上不存在数据绑定事件吗 我只想绑定我的所有数据,并在最后创建一个新的ItemTemplate并添加它,但就在所有数据绑定时,我使用它来计算集合中的总小时数。即使我将其放入页脚模板中,您也应该能够理解这一点 我使用它来计算集合中的总小时数。即使我将其放入页脚模板中,您也应该能够理解这一点 谢谢,如果(e.Item.ItemType==ListItemType.Footer):)这就是我需要的吗?谢谢,如果(e.Item.ItemType==ListIt
我只想绑定我的所有数据,并在最后创建一个新的ItemTemplate并添加它,但就在所有数据绑定时,我使用它来计算集合中的总小时数。即使我将其放入
页脚模板中
,您也应该能够理解这一点
我使用它来计算集合中的总小时数。即使我将其放入
页脚模板中
,您也应该能够理解这一点
谢谢,如果(e.Item.ItemType==ListItemType.Footer):)这就是我需要的吗?谢谢,如果(e.Item.ItemType==ListItemType.Footer:)这就是我需要的吗
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();
}
}