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 = "没有相关数据";
}
}
}
}
{
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 = "没有相关数据";
}
}
}
}
相关文章推荐
- ASP.NET GridView_第五篇_用途多多的 OnRowDataBound 事件
- Didn't find class "android.support.v7.widget.CardView" on path: DexPathList[[zip file "/data/app/com
- gridview控件中OnRowDataBound属性作用
- ORA-01157报错"cannot identify/lock data file" ORA-01219:database not open:queries allowed on fixed
- Asp.Net2.0中GridView的DataFormatString="{0:yyyy-MM-dd}"不起作用解决办法
- java.lang.ClassNotFoundException: Didn't find class "*****Activity" on path: /data/app/*******.apk
- Asp.Net2.0中GridView的DataFormatString="{0:yyyy-MM-dd}"不起作用解决办法
- ASP.NET的gridview设置数据格式(DataFormatString="{}")
- Solution: 无法察看SQL Server 数据库属性 错误: "There is no row at position 0. (System.Data)"
- Android:java.lang.ClassNotFoundException: Didn't find class "*****Activity" on path: /data/app/*****
- java.lang.ClassNotFoundException: Didn't find class "*****Activity" on path: /data/app/*******.apk的错
- Microsoft JDBC "ResultSet Can Not Re-Read Row Data" Error解决办法
- asp2.0 GridView OnRowDataBound event
- java.lang.ClassNotFoundException: Didn't find class "xxxxActivity" on path: /data/app/xxxx.apk的错
- on the web appear:"No data returned for this view.This might be because the applied filter excludes
- On NTFS there is metadata (data which "lives above" your data).
- GridView“GridView1”激发了未处理的事件“RowDeleting"(转)
- java.lang.ClassNotFoundException: Didn't find class "*****Activity" on path: /data/app/*******.apk
- asp2.0 GridView OnRowDataBound event [转帖]
- java.lang.ClassNotFoundException: Didn't find class "*****Activity" on path: /data/app/*******.apk