问题描述
Dim Gross As Decimal = 0
Dim i As Integer = 0
If(DataGridView1.Rows.Count> 0)然后
{
For i = 0 To DataGridView1.Rows.Count
{
Gross = Gross + Convert.ToDecimal(((lblAmount)DataGridView1 .Rows [i] .FindControl(lblAmount))。Text.ToString())
}
下一页
}
结束如果
我使用上面的代码显示标签中数据gridview中Amount列的总数。
Gross = Gross + Convert.ToDecimal(((lblAmount) .Rows [i] .FindControl(lblAmount))。Text.ToString( ))
突出显示的零件系统上的
给出错误'')''预期。我正在使用VB.net。
请给我正确的语法。
Dim Gross As Decimal = 0
Dim i As Integer = 0
If (DataGridView1.Rows.Count > 0) Then
{
For i = 0 To DataGridView1.Rows.Count
{
Gross = Gross + Convert.ToDecimal(((lblAmount)DataGridView1.Rows[i].FindControl("lblAmount")).Text.ToString())
}
Next
}
End If
I used above code for display total of Amount column in data gridview in label.
Gross = Gross + Convert.ToDecimal(((lblAmount).Rows[i].FindControl("lblAmount")).Text.ToString())
on highlighted part system gives an error '')'' expected.I am using VB.net.
Please give me correct syntax.
推荐答案
这篇关于如何在标签上的数据网格视图中显示总计。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!