0
我想获得特定的单元格值,所以我可以将它传递给我的方法,当我按下按钮,但我总是空两个(我知道这不是空值)。如何从RadGrid中的单元格获取值C#asp.net
P.s:没有行被选中,因为我做了一个循环来获取所有行。变量“p”越来越正确我在网格上的行数。
protected void PostRadButton_Click(object sender, EventArgs e)
{
int p;
if (DocStatTxtBox.Text == "2")
{
foreach (GridDataItem item in RadGrid1.Items)
{
p = item.RowIndex;
string itemcodeparam = item["ItemCode"].Text;//error null (4th cell)
int quantityparam = Convert.ToInt16(item.Cells[5].Text);//error null
Boolean x = Methods.UpdateStock(WhTxtBoxRadDropDownList.SelectedValue,itemcodeparam,-quantityparam);
}
}
}