日期:2014-05-17 浏览次数:20497 次
//主repeater行绑定
protected void gv_list_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
string code = Request.QueryString["code"].ToString();
HiddenField hid_code = (HiddenField)e.Item.FindControl("hid_code");
Label lb_td = (Label)e.Item.FindControl("lb_td");
Repeater rp_list = (Repeater)e.Item.FindControl("rp_list");
rp_list.ItemDataBound += new RepeaterItemEventHandler(rp_list_ItemDataBound);
DataSet ds = baseinfo.BindInfo("V_成本核算", "类别='材料' and 客户编号=" + int.Parse(code) + " and 部位编号=" + int.Parse(hid_code.Value));
rp_list.DataSource = ds.Tables[0].DefaultView;
rp_list.DataBind();
}
} //子repeater明细绑定事件
protected void rp_list_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
foreach (RepeaterItem item in this.gv_list.Items)
{
Repeater rp_list = (Repeater)item.FindControl("rp_list");
DataView dv = (DataView)rp_list.DataSource;
object sc = dv.Table.Compute("SUM(市场金额) ", "");