计算网格中的工资,在运行时必须输入值 [英] calculating salary in a grid where at runtime the values has to be inputted

查看:67
本文介绍了计算网格中的工资,在运行时必须输入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将数据添加到网格nd计算coloumn数据末尾的netsalary在网格中运行时从用户获取值..?

How to add data to a grid nd calculate the netsalary at the end of the coloumn data tat get values from the user at run time in the grid..?

推荐答案

protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{

if (e.Row.RowType == DataControlRowType.DataRow)
{
TotalPrice += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Total"));
}
if (e.Row.RowType == DataControlRowType.Footer)
{
TextBox lbltotal = (TextBox)e.Row.FindControl("txttotalprice");
lbltotal.Text = TotalPrice.ToString();
}









此代码用于自动生成总列中记录的总和。





this code is used to auto generate the sum of the records in total column.


这篇关于计算网格中的工资,在运行时必须输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆