有99行的DataGrid,每行上有2个绑定的TextBox,怎样捕获到当前正在编辑的一个TextBox?
(通过焦点可以吗?怎样获得)

解决方案 »

  1.   

    where are you trying to get it? on the server side? did you give your TextBox an ID? if yes, tryTextBox tb = (TextBox)YourDataGridID.Items[n].FindControl("YourTextboxID");on the client side? you could do in javascript:var tbl = document.getElementById("YourDataGridID");
    var inputs = tbl.rows[n].all.tags("INPUT");
    if (inputs.length > 0 && inputs[0].type == "text") //first one, [0], second one [1]
    {
      //
    }
      

  2.   

    你是不是用的系统的列,还是用的摸板列系统的:
    ctype(datagrid.items(datagrid.edititemindex).cells(0).comtrols(0),textbox).text
    摸板:
    ctype(datagrid.items(datagrid.edititemindex).cells(0).findcontrol("txtboxID"),textbox).text