일요일부터 토요일까지 시작하는 GridView에 7 개의 열이 있습니다. 각 열 내에 값을 추가하고 꼬리말에 표시해야합니다. 단일 열에 대해 시도했지만 각 열에 대해 수행 할 수 없습니다.GridView에서 각 열의 합계 값 계산 및 바닥 글에 표시
int total=0;
protected void gvEmployeeTimeSheet_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblsaturday = (Label)e.Row.FindControl("lblSaturday");
int qty = Int32.Parse(lblsaturday.Text);
total = total + qty;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblTotalqty = (Label)e.Row.FindControl("lblFootersaturday");
lblTotalqty.Text = total.ToString();
}
}
다른 열에 대해서도 같은 일을하지 않으시겠습니까? – Sam