您的位置:首页 > 其它

gridview data OnRowDataBound ="CalculateExtendPrice"

2007-07-19 12:15 363 查看
protected void CalculateExtendPrice(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[8].Text != null && e.Row.Cells[9].Text != null)
{
try
{
double price = double.Parse(e.Row.Cells[8].Text);
double num = double.Parse(e.Row.Cells[9].Text);
e.Row.Cells[10].Text = string.Format("{0:c}", num * price);
e.Row.Cells[8].Text = string.Format("{0:c}", price);
GridView1.Visible = true;
}
catch (Exception)
{
// lbldatastate.Text = "没有相关数据";
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐