单击datagrid某一行的按鈕,怎样查找该行的其它控件?

解决方案 »

  1.   

    dg1.Items[i].FindControl("TextBox")//i为按纽所在行....
      

  2.   

    在按钮的单击事件应该根据按钮的commandname在itemcommand事件里面写
    ControlType mycon=(ControlType)e.item.cells[i].FindControl("ControlID");!
      

  3.   

    在按钮的单击事件应该根据按钮的commandname在itemcommand事件里面写
    ControlType mycon=(ControlType)e.item.cells[i].FindControl("ControlID");!
    什麽意思?
      

  4.   

    需要是能激发onItemCommand的控件
    在后台
    sub datagrid_itemcommand() handles datagrid.itemcommand
      dim label as label
      label = e.item.findcontrol(labelname)  dim button as button
      button = e.item.findcontrol(buttonname)
    end sub
      

  5.   

    ControlType mycon=(ControlType)e.item.cells[i].FindControl("ControlID");ControlType 是说控件的类型。
    假设是label的话
    Label mycon=(Label)e.item.cells[i].FindControl("ControlID");ControlID 指的是Label的id。
      

  6.   

    如果要查找boundItem的内容,用e.Rows[idx][col].Text就可以了
    如果是按钮、文本框等,就用Control control = e.Items[idx].FindCondControl("控件id");
    再转换为相应的控件来使用。
      

  7.   

    在按钮的单击事件应该根据按钮的commandname在itemcommand事件里面写
    ControlType mycon=(ControlType)e.item.cells[i].FindControl("ControlID");!是什麽意思呢?