大家下午好?
如题,搞了一天了.找了很多东西,就是解决不了.
再哪个事件中写啊?如果在模板列中该怎么去呢?谢谢!

解决方案 »

  1.   

    你是通过什么方式确定哪行被选中的?
    模版列用FindControl
    example: 模版列中有一个隐藏控件 (this.GridView.Rows[i].FindControl("id") as HiddenField).Value
      

  2.   

    发1:this.GridView1.Rows[this.GridView1.SelectedIndex+1].Cells[2].Text
    发2:e.Row.Cells[1].Text  
    都不行啊?
      

  3.   

    你的GirdView的SelectIndexChang事件有吗?
      

  4.   

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
            texbox1.Text = GridView1.Rows(GridView1.SelectedIndex).Cells(1).Text
        End Subcells(1)取得第二个单元格的值 .自己修改下就可以
      

  5.   

    我找了很长时间啊..........刚从自带的msdn上找到,你就发过来了.谢谢了!
      

  6.   


            HtmlInputChecked ckball= null;
            string strUserCode="";
            foreach (GridViewRow gdVRow in GView.Rows)
            {
                ckball= (HtmlInputChecked )gdVRow.FindControl("ckball");
                if(ckball.checked==true)
                {  if(strUserCode=="")
                   {strUserCode=ckball.value;}
                   else
                   {strUserCode+=","+ckball.value;}        }