C#语法 ;(datagridObj.item[itemIndex].cell[cellPostion].Text

解决方案 »

  1.   

    Dim quantity As String
    TextBox text;
    text = e.Item.Cells[0];'这里的0是指单元格的index
    quantity = text.Text
      

  2.   

    quantity = val(ctype(e.item.findcontrol("quantity"),textbox).text)
      

  3.   

    e.Item.FinControl找到quantity控件,然后取出值。
      

  4.   

    比方说模版列是第3列,你在模版列的EditTemplate中加入了一个名为txtQuantity的TextBox,那么引用它的Text属性的代码(C#)为:TextBox txtQ = (TextBox)e.Item.Cells[2].FindControl("txtQuantity");
    Int32 quantity = Int32.Parse(txtQ.Text);