enter code here
我有以下函数可以将网格中特定列的总数相加。如何通过asp访问独立文本框中的最高GB?我试过这个,但没有成功。
Discovery Jobs ' > 谁能解释一下,谢谢。
double highestGB = 0;
protected void grd_JobTypeJT_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridFooterItem)
{
footerItem["GB"].Controls.Add(new LiteralControl("Total: <br/>" + highestGB));
}
else if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
string GB = dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["GB"].ToString();
double gbValue = Double.Parse(GB);
totalPrice += gbValue;
if (highestGB == 0 || highestGB < gbValue)
{
highestGB = gbValue;
}
}